jaredonline / google-authenticator

Ruby gem to implement Google's MFA authenticator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code difference between app and gem

c2ofh opened this issue · comments

commented

Hi,

2 days ago I've added this gem to my pre-production release and registered the application by scanning the QR-Code.

I've entered the code and was logged in.

Today there is the issue, that the code does not match.
ROTP::TOTP.new(user.google_secret).now.to_s returns another code as the app displays.
The local time matches the server time, only 1 second difference.

With the above mentioned command, the code changes also one second after the app.

Gem Configuration

has_secure_token
acts_as_google_authenticated issuer: 'myappname', lookup_token: :token

The Token is a unique key, and will be generated, after the creation of a user.

What can cause this problem? :(

Heya @c2ofh sorry I didn't get to this yesterday. Did you get the problem fixed?

commented

hey @jaredonline yes... it was my fault. I've tried it again today and again the same problem.
Just for the case I wrote down the old google_secret, and it was different today.

I accidently used current_user.set_google_secret again in the controller. So I had a different code.