Two Factor Authentication
Rob Stevens
Posts: 2

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
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: 1 year 4 months ago by Rob Stevens .
Please Log in or Create an account to join the conversation.
George Mikhailovsky
Posts: 5

George Mikhailovsky replied the code: Two Factor Authentication
Bruce, I confirm that QR identification works fine for me in both PB2019/PS2020 and PB2021/PS2021 environments. Thanks, George
Please Log in or Create an account to join the conversation.
VINOD NAIR
Posts: 2

VINOD NAIR replied the code: Two Factor Authentication
Hi Bruce,
We were able to make it work in PS 2020. The issue was related to the Encode function and not related to the QR Code. We created a DLL to encompass Encode function and call it from Powerbuilder and it resolved our issues on web. This was suggested to us by Appeon ....see below
For base32 encoding, please package it as DLL according to the source code online and then call it in PB. It should work on web too. Please refer to the
article below for details.
gist.github.com/BravoTango86/2a085185c3b9bd8383a1f956600e515f
social.msdn.microsoft.com/Forums/en-US/d...-code?forum=netfxbcl
We were able to make it work in PS 2020. The issue was related to the Encode function and not related to the QR Code. We created a DLL to encompass Encode function and call it from Powerbuilder and it resolved our issues on web. This was suggested to us by Appeon ....see below
For base32 encoding, please package it as DLL according to the source code online and then call it in PB. It should work on web too. Please refer to the
article below for details.
gist.github.com/BravoTango86/2a085185c3b9bd8383a1f956600e515f
social.msdn.microsoft.com/Forums/en-US/d...-code?forum=netfxbcl
Please Log in or Create an account to join the conversation.
Bruce Armstrong

CODE AUTHOR
Posts: 58
Bruce Armstrong replied the code: Two Factor Authentication
I just tried it with PowerServer 2021 and it worked fine. Of course, that one doesn't attempt to generate a web application. I really can't speak to how it works with PowerServer 2020.
Please Log in or Create an account to join the conversation.