Skip to content
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

TOTP check does not work on distributed systems #655

Open
rosshettel opened this issue Aug 13, 2021 · 1 comment
Open

TOTP check does not work on distributed systems #655

rosshettel opened this issue Aug 13, 2021 · 1 comment

Comments

@rosshettel
Copy link

Describe the bug
Testing OTP login locally with one server works correctly, but when deployed to AWS with multiple containers behind a load balancer, totp.check() takes multiple tries to pass. Upon investigation, it appears that only the original container that generated the OTP successfully passes the totp.check(). I'm storing the totp secret key in the database, so all servers have access to the same secret. They're also all synced to the same time.

Expected behavior
totp.check() works with the same token and secret regardless of system

Details (please provide any relevant information):

  • otplib version: 12.0.1
@rosshettel
Copy link
Author

Just a follow up on this, I switched to this library: https://www.npmjs.com/package/notp, since it is mostly a drop in replacement API wise, and no longer run into this issue. So not sure what's going on with this library that doesn't like multiple containers, but happy to provide any more info to help debug this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant