Two Factor Authentication

Panos Platanas
 1 month 3 weeks ago -  1 month 3 weeks ago #540 by Panos Platanas
Panos Platanas replied the code: Two Factor Authentication
Thank you Bruce!
I am trying to run this on PB2017R3 but build fails:
Uknown function name base32encode

What should I check?

Thanx!

Last Edit: 1 month 3 weeks ago by  Panos Platanas

Please Log in or Create an account to join the conversation.

Rob Stevens
 5 months 2 weeks ago #529 by Rob Stevens
Rob Stevens replied the code: Two Factor Authentication
Thanks Bruce
I since found the below url that appears to work
api.qrserver.com/v1/create-qr-code

And was able to just replace the google api with it. ie

ls_chart_url = 'api.qrserver.com/v1/create-qr-code/?size=' + String ( width ) + 'x' + String ( height ) + '&data=' + ls_provision_url

We may use this as a quick interim solution until we look at integrating your QR dll.

Kind regards
Rob

Please Log in or Create an account to join the conversation.

Bruce Armstrong
CODE AUTHOR
Posts: 55
 5 months 2 weeks ago #528 by Bruce Armstrong
Bruce Armstrong replied the code: Two Factor Authentication
Yes, it should be that simple. There's nothing magic about a TOTP url (except perhaps the otpauth://totp/ prefix). It's just a text string that can be encoded just like any other URL or text string.

Please Log in or Create an account to join the conversation.

Rob Stevens
 5 months 2 weeks ago -  5 months 2 weeks ago #527 by Rob Stevens
Rob Stevens replied the code: Two Factor Authentication
Hi Bruce
Our call to the google chart API has stopped working so it looks like they have finally turned if off.
I've found your QR Code Demo - but I haven't been able to find any examples of code to date using it to generate a QR code for two factor authentication.
Is this available?

Is it as simple as passing in the resulting ls_provision_url below

blob lblb_provision_url
string ls_keystring, ls_provision_url
n_base32 lnv_base32
CoderObject co

co = create CoderObject

ls_keystring = lnv_base32.of_encode( key )
ls_provision_url = 'otpauth://totp/' + identifier + '?secret=' + ls_keystring
lblb_provision_url = Blob ( ls_provision_url, EncodingUTF8! )
ls_provision_url = co.urlencode( lblb_provision_url )

To
inv_generator.of_generateqrcode(ls_provision_url)


Kind regards
Rob

Last Edit: 5 months 2 weeks ago by  Rob Stevens

Please Log in or Create an account to join the conversation.