kratos
kratos copied to clipboard
Request to make TOTP period configurable
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
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.
Is this really hardcoded to 30 sec? IMO we can just extend this to 5 min. @zepatrik ?
30 seconds is the default specified in the TOTP RFC (as well as industry standard) and it should not be changed without good reason.
Are we talking about the individual code validity period? Or the total time the user has to complete the flow?
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?