Two Factor Authentication

This message has an attachment file.
Please log in or register to see it.
Last Edit: 1 year 7 months ago by Bruce Armstrong . Reason: Updating code to work with PowerServer and correct timestamp structure defintion
Please Log in or Create an account to join the conversation.

I've tested the code and see that QR code generation doesn't work with the Google API.
I've taken the liberty of adapting Bruce's example and adding my QR code generation libraries, so I can test that it does work. I've simplified the generateprovisioningimage function of the u_google_authenticator object.
Now I don't have to pass it the QR code dimension, and it returns a string with the path to the generated code instead of a blob. I've renamed it of_generateprovisioningimage.
Then I've decorated the example as I do with all of mine. I hope you don't mind, Bruce.
I'm leaving you here a copy of today's project in Powerbuilder 2025 build 3711 (Solution) but I always recommend that you download it from Git Hub in case there is an update:
github.com/rasanfe/TwoFactorAuthDemo
To be aware of what I publish you can follow my blog in Spanish:
This message has an attachment file.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.

I can't see anyway in Google Authenticator (at least on iOS) to change the settings so that it might generate different values. And Google Authenticator on iOS is what I used when I demonstrated the use of the routine at several Elevates. I can't explain why it's not working for you.
Actually, I can think of one thing. TOTPs are sensitive to the computer you are generating the value on having it's system time set correctly. If that is off by a few seconds, then the wrong interval will be calculated and you will get different values. Make sure the time on your iOS device is correct.
Last Edit: 1 year 2 weeks ago by Bruce Armstrong .
Please Log in or Create an account to join the conversation.

Only one strange issue: It operates just fine with Google Authenticator on Android but not with Google Authenticator using iOS.
Even more strangely, if I use a different 2FA app on iOS, it works.
Have you got any idea why this may happen?
Thank you
Please Log in or Create an account to join the conversation.