- You are here:
-
Home
-
CodeXchange
-
All
-
PowerBuilder
- Two Factor Authentication
Two Factor Authentication
- Bruce Armstrong
-
Code Author
- Offline
- Posts: 32
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.
- George Mikhailovsky
-
- Offline
- Posts: 4
I deploy to localhost, i.e., to the same server where I ran my C/S application that works fine. But after your message, I checked system time on my server and it is exactly the same as on my IPhone. Moreover, I ran the modified generatepin() function triple:
Pin1 = generatepin ( key, CurrentInterval - 1)
Pin2 = generatepin ( key, CurrentInterval )
Pin3 = generatepin ( key, CurrentInterval + 1)
for previous, current and next 30 seconds but none of the Pins matched with the token on my IPhone.
Thank you very much for your help!
I will let you know if find a solution,
George
Please Log in or Create an account to join the conversation.
- Bruce Armstrong
-
Code Author
- Offline
- Posts: 32
Please Log in or Create an account to join the conversation.
- George Mikhailovsky
-
- Offline
- Posts: 4
I created both these functions and call them in generatepin(key, counter) function instead of longtobytearray() and counterBlob():
//Convert the counter to byte array and then to blob
of_copylongtobytes( counter, counterBytes )
counterBlob = of_blob( counterBytes )
//longtobytearray ( counter, counterBytes )
//counterBlob = Blob ( counterBytes )
After this generatepin() began return 6-digits pin instead of '000000' but each time these 6 digits are the same and doesn't match digits in DioMobile on my IPhone, At the same, hashBytes array is popuilated with 20 elements.
In C/S application with longtobytearray() and counterBlob() functions everything worked fine. By the way, I have the latest PowerServer 2020.
I would be very appreciated for any ideas,
George
Please Log in or Create an account to join the conversation.
- George Mikhailovsky
-
- Offline
- Posts: 4
I will try this workarounds,
George
Please Log in or Create an account to join the conversation.
- Bruce Armstrong
-
Code Author
- Offline
- Posts: 32
community.appeon.com/index.php/articles-...uilder#comment-403,0
Please Log in or Create an account to join the conversation.
- George Mikhailovsky
-
- Offline
- Posts: 4
Thank you for your great job! I used your twofactorauth.pbl and its objects work without any problems in C/S version of my application. However, when I deployed it as web application, your u_google_authenticator.generatepin() function began to return '000000' instead of real pin.
Is this a problem that can be fixed or your PBL cannot work in web applications?
Best regards,
George Mikhailovsky
Please Log in or Create an account to join the conversation.
- Bruce Armstrong
-
Code Author
- Offline
- Posts: 32
Thierry Garrigues wrote: Hi
Do you have information or code samples to integrate this example with Google's authentication APIs?
Regards
Perhaps you could post your question with additional information about what you're trying to do in the forums.
Please Log in or Create an account to join the conversation.
- Thierry Garrigues
-
- Away
- Posts: 2
Do you have information or code samples to integrate this example with Google's authentication APIs?
Regards
Please Log in or Create an account to join the conversation.
- Bruce Armstrong
-
Code Author
- Offline
- Posts: 32
Two factor authentication doesn't use any Google account apis. The only google api call I make at all is to a charting api to generate the QR code.
Please Log in or Create an account to join the conversation.
- Bruce Armstrong
-
Code Author
- Offline
- Posts: 32
This has nothing to do with Google mail. If you're looking for code to send Google email from PowerBuilder I suggest you look at this code sample which does it through .Net called from PowerBuilder ( community.appeon.com/index.php/codeexcha...56-net-importer-demo ) or the PBNISMTP utility, which does it through PBNI ( github.com/bruce-armstrong/pbnismtp )
Please Log in or Create an account to join the conversation.