kratos icon indicating copy to clipboard operation
kratos copied to clipboard

Request to make TOTP period configurable

Open ehblh opened this issue 1 year ago • 4 comments

Preflight checklist

Ory Network Project

No response

Describe your problem

We have received user feedback indicating that some of our customers find it challenging to enter the TOTP code within the current 30-second window. This can lead to authentication failures and user frustration. We want to provide our users with a more comfortable authentication experience by extending the TOTP validity period to 60 seconds.

Describe your ideal solution

We propose adding a configuration option in Ory Kratos that allows administrators to specify the TOTP validity period. Ideally, this configuration parameter should be included in the Ory Kratos configuration file (e.g., kratos.yml) and accept values in seconds. This way, organizations can adapt the TOTP code expiration time to their specific security and usability requirements.

Workarounds or alternatives

Currently there is no workarounds because 30-second valid period is hard-coded in the code.

Version

v1.0.0

Additional Context

  • Providing the ability to configure the TOTP validity period is crucial for meeting the diverse security and usability requirements of our users.
  • By implementing this feature, Ory Kratos can cater to a wider range of use cases and ensure a more user-friendly and adaptable authentication process.
  • Clear and detailed documentation should accompany this feature to guide administrators on how to configure the TOTP validity period according to their needs while understanding the potential security implications.

ehblh avatar Oct 05 '23 10:10 ehblh

Is this really hardcoded to 30 sec? IMO we can just extend this to 5 min. @zepatrik ?

alnr avatar Oct 17 '23 14:10 alnr

30 seconds is the default specified in the TOTP RFC (as well as industry standard) and it should not be changed without good reason.

aeneasr avatar Oct 17 '23 14:10 aeneasr

Are we talking about the individual code validity period? Or the total time the user has to complete the flow?

alnr avatar Oct 17 '23 14:10 alnr

I think it is best practice while working with TOTP to not only accept the latest 6 digit token for validation but also the one that was valid before. So even if the code changes while the user is checking he can still use the old and the new one. @ehblh Would this help your users?

Robert-Bosse avatar Oct 30 '23 12:10 Robert-Bosse