-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use 2FA #23
Comments
Can you please provide a repo of the issue, or provide much more detailed instructions on how to reproduce this? If it is only happening on production, yet works locally, could it be something is misconfigured on your server? |
Unfortunately I cannot provide a repo as it's a client project. Do you have any idea what kind of misconfiguration could affect this? The package used to work, and we can't recall anything that may have affected this. Edit: I completely understand your need for more detailed steps, but I'm afraid that is all I can give you. In the meantime, we will debug the source code in the production environment to see if we can log anything interesting. |
To me it sounds like an issue with the key - if it isn't accepting codes, they rely on the key. If you are able to find steps to replicate it, please let me know. It's just hard to fix something that we can't replicate. |
@martyf It seems to fail here:
When diving deeper, it takes you here: https://github.com/antonioribeiro/google2fa/blob/4e1f0e88c799e6893a02259403063afb64b58249/src/Google2FA.php#L82 When dumping both values that are compared inside
From here I don't know how to continue, as it seems to go wrong in the Google 2FA package. |
I still feel this is an issue with your server configuration. The related package is stable, and is also the same package that Laravel Fortify uses: if there were a more widespread issue, I'd expect others to have the issue too and not just with this package, but Fortify too. Can you confirm that it works as expected locally, with a database? On your server where you're having problems, can you try something for me please. When trying to use a code (where they are regularly failing) can you try a fresh code (i.e. 30 second expiry left), a mid-code (i.e. 15 seconds left) and a nearly-expired code (i.e. 2 seconds left). I wonder if there's a time sync issue perhaps? |
Just checking in @dnwjn to see if you had any update to this issue? |
I haven't had the time yet to test your theory, I should be able to get back to you later this week! |
@martyf So here's the weird thing. We left it disabled for a few days, until someone had time to work on it again. That was me today. I started with enabling it again and setting it up, but this time it worked. No changes have been made, no updates have been done, but it just works. I've tested with different timings as you suggested, but all of them worked without any issues. As I don't have any other leads right now on where to look, and since I don't have any errors, I think we can close this. If it does happen again in the future I will start with the timings, and continue debugging from there. |
Thanks for the update... if you encounter this again, be curious to see if those sorts of tweaks and debugging can give any insight in to what is happening. I'll close off this ticket now. |
Bug description
We're unable to use 2FA. The first issue is that it seems that after the validity expires (we use the default of
43200
), the users are not able to log in anymore, because the 2FA code doesn't work, nor does a recovery code.Secondly, we're also unable to set up 2FA now. For our own user we removed all 2FA related data from the user in the database. Then, after logging in, we had to set up 2FA again. However, when scanning the QR and entering the code, we get an error:
Unfortunately, this is currently unusable, forcing us to disable the package.
Weirdly enough, this is only happening in our production environment, not local.
Steps to reproduce
Environment and versions
Additional details
No response
The text was updated successfully, but these errors were encountered: