Closed
Conversation
Provided to OneTimeTokenService constructors to customize expire time when generating OneTimeToken
Contributor
|
@R4N thanks for suggestion. This is probably not something we would like to add to the framework now. At the same time, we need to think about more flexible possibilities for customizing the API of the |
Author
|
Will do, closed favor of this ticket with a few different implementation ideas for discussion: #16291 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provided to OneTimeTokenService constructors to customize expire time when generating OneTimeToken
We've started implementing OneTimeTokenLogin after it's recent inclusion in Spring Security and appreciate this great feature addition.
During testing, the default expiration time (5 minutes) seems to be sufficient. As we move towards production usage we've started considering more scenarios which we think may warrant increasing it: delayed mail delivery, user doesn't check the email right away, etc. Because of this, we're planning on increasing the expiration time slightly (to 10 or 15 minutes).
We've switched over to using JdbcOneTimeTokenService for production, but when looking for a spot to modify the expiration time, we saw that there wasn't an option present to do so.
After consulting the documentation, there is mention of modifying the one-time token expire time by creating a Custom OneTimeTokenService.
A full custom implementation to only override the expire time is potentially risky as it requires implementing/duplicating the majority of the logic (in JdbcOneTimeTokenService) which doesn't need to change in order to fulfill this type of behavior.
This PR includes:
OneTimeTokenSettingswhich has a property for the OneTimeToken timeToLive Durationgenerateimplementations now use the OneTimeTokenSettings timeToLive Duration value when establishing the expire timeSubmitted on behalf of Zetetic, LLC