-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Consider a clustered RESTful application that generates and validates TOTP using this library.
Is it sufficient to use the same seed across all replicas of the application in order to produce a TOTP that would be validated by any other replica node? In other words, is it safe to assume that each replica node, given the same configuration, should produce the same TOTP and should be able to validate the TOTP produced by any other node?
If the above is true, how to deal with the fact that once the OTP is used on one node, being it a one-time password, no other replica node should accept it?
Is this something users would need to build on top of the library? How about defining a pluggable strategy that would allow your users to store the generated TOTP in a shared storage, for example a self-expiring distributed cache based on hazelcast? If a used token was stored in a shared map (user -> token) until it expires and is removed, no other node would be able to use it.