samdjstevens / java-totp

A java library for implementing Time-based One Time Passwords for Multi-Factor Authentication.
MIT License
448 stars 109 forks source link

qr code doesn't work in ios google authenticator #46

Open hamidreza-ka opened 3 years ago

hamidreza-ka commented 3 years ago

Hi, that qr code we generate work fine in android google auth but doesn't work in ios. can you help me ?

pauloemmilio commented 2 years ago

Hi, @Karimi1381

I was having the same problem and found the google authenticator app doesn't work well with other SHA options besides SHA1.

In my case I was using SHA256 and the codes generated between ios and android were different, when switching to SHA1 (less secure) the codes were the same and it worked for both platforms.

I don't know if your problem is exactly this, but if it is, you can verify it using the google authenticator app and the FreeOTP app at the same time on android. If you use a different SHA than SHA1, they will generate different codes and the FreeOTP code will be the same as the code that would be generated on an ios device.

Stexxen commented 2 years ago

Please see https://github.com/samdjstevens/java-totp/issues/30 for further info on App support