Skip to content

TOTP check does not work on distributed systems #655

@rosshettel

Description

@rosshettel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions