Levminer / authme

Simple cross-platform two-factor (2FA) authenticator app for desktop.
https://authme.levminer.com
GNU General Public License v3.0
309 stars 25 forks source link

Import from 2FAS Authenticator #288

Closed Levminer closed 3 months ago

Levminer commented 4 months ago

Import file format: https://github.com/twofas/2fas-android/issues/117

sameer4 commented 3 months ago

@Levminer not working for me here's a video.. https://www.loom.com/share/f47cf434ba354beea9c6ffa7eb799d82?sid=45f0b2a7-b781-45a0-84e4-b422724c99ae

am i missing something? i exported backup without password.

Levminer commented 3 months ago

@Levminer not working for me here's a video.. https://www.loom.com/share/f47cf434ba354beea9c6ffa7eb799d82?sid=45f0b2a7-b781-45a0-84e4-b422724c99ae

am i missing something? i exported backup without password.

Thanks for the report!

frankbret commented 2 months ago

Trying to import 2fas iOS 5.3.5 backup export (without password). Backup_2024-04-09_blank.2fas.json

[AUTHME LOG] (2024. 04. 09. 14:35:12) Authme 5.1.0 alpha.240401.133357 [AUTHME LOG] (2024. 04. 09. 14:35:12) Path changed: / [AUTHME LOG] (2024. 04. 09. 14:35:12) Path changed: /codes [AUTHME LOG] (2024. 04. 09. 14:35:13) Path changed: /import [AUTHME LOG] (2024. 04. 09. 14:35:21) Path changed: /codes [AUTHME ERROR] (2024. 04. 09. 14:35:21) Failed to generate TOTP code from secret [AUTHME ERROR] (2024. 04. 09. 14:35:21) Unknown runtime error occurred: TypeError: Cannot read properties of undefined (reading 'names')

In the UI : Failed to generate TOTP code from secret. Make sure you import file is correct!

Thank you for your invaluable work !

Levminer commented 2 months ago

Trying to import 2fas iOS 5.3.5 backup export (without password). Backup_2024-04-09_blank.2fas.json

[AUTHME LOG] (2024. 04. 09. 14:35:12) Authme 5.1.0 alpha.240401.133357 [AUTHME LOG] (2024. 04. 09. 14:35:12) Path changed: / [AUTHME LOG] (2024. 04. 09. 14:35:12) Path changed: /codes [AUTHME LOG] (2024. 04. 09. 14:35:13) Path changed: /import [AUTHME LOG] (2024. 04. 09. 14:35:21) Path changed: /codes [AUTHME ERROR] (2024. 04. 09. 14:35:21) Failed to generate TOTP code from secret [AUTHME ERROR] (2024. 04. 09. 14:35:21) Unknown runtime error occurred: TypeError: Cannot read properties of undefined (reading 'names')

In the UI : Failed to generate TOTP code from secret. Make sure you import file is correct!

Thank you for your invaluable work !

Thanks for reaching out! In your file the link is broken:

otpauth:\/\/totp\/Leaseweb:blablabla@gmail.com?secret=[hidden]&issuer=Leaseweb should be otpauth://totp/Leaseweb:blablabla@gmail.com?secret=[hidden]&issuer=Leaseweb

frankbret commented 2 months ago

Sorry, don't work, same problem with all backslash not escaped. Probably the iOS version of 2fas is different of Android ? I will try to compare with someone having an Android and check if https://github.com/twofas/2fas-ios/commits/main/ change something about formating.

I tried to debug the app bug but my vscode don't want to start in debugging with nvs :-(

Levminer commented 2 months ago

Sorry, don't work, same problem with all backslash not escaped. Probably the iOS version of 2fas is different of Android ? I will try to compare with someone having an Android and check if https://github.com/twofas/2fas-ios/commits/main/ change something about formating.

I tried to debug the app bug but my vscode don't want to start in debugging with nvs :-(

I did some more debugging and it seems like your secrets are not valid. The file is same with Android and iOS. Changing otpauth://totp/Leaseweb:blablabla@gmail.com?secret=[hidden]&issuer=Leaseweb to otpauth://totp/Leaseweb:blablabla@gmail.com?secret=bca&issuer=bca works.

frankbret commented 1 month ago

Finally found my bug ! The Backup_YYYY-MM-DD.2fas needs to be edited (json text) and manually replace the [hidden] in the "link": "otpauth://totp/ path by the "secret": "123456" item value, one level higher. Ok tradeoff for a programmer like me but could be interesting to automatically do it in the import procedure for the others ;-)

Interesting conversation about 2fas interoperability here.