southbridgeio / redmine_2fa

Two-factor (sms/telegram) authentication for Redmine
https://southbridge.io
MIT License
42 stars 17 forks source link

Google Authenticator QR #90

Open RamJett opened 4 years ago

RamJett commented 4 years ago

Trying to get the Google Authenticator to work but when I scan the QR code it errors with "Error Key not recognized" . When I scan the QR code with a scanner I see this content.

url 
otpauth://totp/localhost:3000admin$issuer=localhost%3A3000

I don't know if this is configuration or something not working. I am using in redmine 4.1-stable on Debian 10

clement-deltel commented 4 years ago

Have you tried after the two commands 'git clone' and 'bundle install' to do a 'bundle update'? For me, three gems were updated during this process and that solved my problem. I think you have to do it before the command 'bundle exec rake redmine:plugins:migrate RAILS_ENV=production'.

mwarnaar commented 4 years ago

I had the same problem on a localhost instance. Solved it by updating Host name and path under general settings from localhost:3000 to just localhost and resetting 2FA from /my/account.

ryota-saito-0309 commented 4 years ago

A similar issue occurs with AWS EC2 instances. I chose'without 2FA' to log in with 2FA disabled. Then I chose'Reset 2 FA' in the personal settings. Then I logged out and selected'Google 2FA' again and it worked fine. When reading the QR code for the first time,'Secret' was not added, but after reset,'Secret' was added to the URI.

URI when first read 'otpauth://totp/localhost:3000:user?issuer=localhost%3A3000'

URI after reset (works properly) 'otpauth://totp/localhost:3000:user?secret=uodvxxx2noad6xxxpndxxxjrqxxxkvx&issuer=localhost%3A3000'

The cause of the problem is unknown.

Please improve someone's code.

nerkrc commented 3 years ago

Hi,

Have someone solved this issue? It's really painful to instruct every user to do additional steps.