d8-contrib-modules / ga_login

DEPRECATED - MOVED TO DRUPAL.ORG -- https://www.drupal.org/project/ga_login
1 stars 1 forks source link

Unable to scan barcode #5

Closed aweingarten closed 8 years ago

aweingarten commented 8 years ago

I have installed tfa and ga_login. I am able to get Drupal to render a QR code for authenticator. When I try to scan it with the authenticator app on my iPhone I get the following error:

"Invalid barcode" "The barcode opaith://hotp/SITE-NAME-username?secret=SOMEHASH&counter=-1 is not a valid token barcode."

For debugging here are my current settings: screen shot 2016-07-05 at 10 05 36 am

nerdstein commented 8 years ago

@therealssj can you take a look at this?

aweingarten commented 8 years ago

additional info it looks like the counter parameter value here is the issue: https://github.com/d8-contrib-modules/ga_login/blob/8.x/src/Plugin/TfaSetup/GALoginHotpSetup.php#L157

By default it's returning -1. If I hard-code to 0, or 1 the phone scan works, however the code doesn't auto-update. I need to press a refresh button on the phone to get the code to update.

therealssj commented 8 years ago

@aweingarten I have pushed a fix, please fetch the TFA and GA Login repos again. Let me know how it goes :)

therealssj commented 8 years ago

@aweingarten Yes you need to press the refresh button. That's how HOTP has been made. But we do store the code and it can't be re-used. Also you don't need to keep a very hard track of whether you pressed the button to refresh or not that is handled by the plugin. Even if you press the refresh button a couple of times the code will still work :)

therealssj commented 8 years ago

Closing this issue as it seems have to be fixed in the latest branch.