Sending OpenOTP QR Code via Email with no Self-Service Apps

262 views
Skip to first unread message

Shawn S

unread,
Mar 1, 2018, 11:31:39 AM3/1/18
to RCDevs Security Solutions - Technical
I would like to be able to send a QR-Code (or it's secret key) to a user via email when I create it manually in WebAdm.
I have my WebAdm configuration setup to forward mail to a mail relay server, where I can do the encryption and security of the email.   But I can find no way to have manually created QR Codes sent from WebAdm.
Additionally, I do not have any self-service apps (pwreset, selfreg, selfdesk) enabled, and currently prefer to keep it that way.

I noticed a similar thread on this a couple years ago:
There was mention of a 'script' for doing this.  If one is available, great.  

Thanks in advance to your response.

francois...@rcdevs.com

unread,
Mar 5, 2018, 2:13:23 AM3/5/18
to RCDevs Security Solutions - Technical
Hi Shawn,

If you don't wan to use our self-services, you can write your own script with the api:

You need to follow these steps if you want the push capability:

Get_Random_Bytes 20 -> key
OpenOTP.Mobile_Session -> session
OpenOTP.TOTP_URI -> uri
Get_QRCode -> scan the qrcode
OpenOTP.Mobile_Response -> wait while == 2 if you want push
OpenOTP.TOTP_Register 

Shawn S

unread,
Mar 6, 2018, 12:23:13 AM3/6/18
to RCDevs Security Solutions - Technical
Francois;

Thanks for the reply.  This is helpful.

I'm using OpenOTP version 1.3.8.  Under the /opt/webadm/websrvs/openotp/export.xml file, I don't find a 'Get_QRCode' method, but I do see a 'Token_QRCode' method that appears to do the same thing-- return a Base64 string representative of the QRCode image that one would get in WebAdm with registration.  I will try to use that method to get the string, decode it, and send it by email.

(Note:  in the export.xml file, it says that the method is being 'deprecated'.   But I don't see any method in the file that replaces it.).

I'll try in the next couple days to get a script successfully running,  and reply back once completed.

francois...@rcdevs.com

unread,
Mar 6, 2018, 2:58:56 AM3/6/18
to RCDevs Security Solutions - Technical
Hi Shawn 

It's in /opt/webadm/lib/schemas/webadm_export.xml

You can also found them in WebADM > Admin > Remote Manager Interface
You can

Shawn S

unread,
Mar 15, 2018, 12:26:32 PM3/15/18
to RCDevs Security Solutions - Technical
Francois;
Ok, I got a working script written in perl with the mojolicious Mojo::UserAgent and Mojo::JSON modules for the JSON-RPC transaction.  It grabs existing QR Code and sends via email as an image GIF attachment.

Sharing this on github at

Thanks again for your help.
Reply all
Reply to author
Forward
0 new messages