Validate account status in OneTimeTokenAuthenticationProvider - #17656
Merged
Conversation
therepanic
force-pushed
the
gh-17655
branch
2 times, most recently
from
August 2, 2025 13:30
c7c8f08 to
971a23c
Compare
therepanic
marked this pull request as ready for review
August 2, 2025 13:31
therepanic
commented
Aug 2, 2025
|
Hi, thanks for the work on this PR! This feature would be very useful for us. Appreciate the effort! |
jzheaux
requested changes
Mar 31, 2026
jzheaux
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, @therepanic, for the PR! I've left some feedback inline.
The main problem is that OneTimeTokenAuthenticationProvider does not extend from AbstractUserDetailsAuthenticationProvider, which has a preauthentication check for user details. However, we do not need to extend from it because it does not fit the context of the class. In this regard, I decided to add my own checker to this commit, which performs a preauthentication check before authorizing the account, similar to how it is done in AbstractUserDetailsAuthenticationProvider. I also added a test to OneTimeTokenAuthenticationProviderTests that identifies this problem. Closes spring-projectsgh-17655 Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
OneTimeTokenAuthenticationProvider no longer validates account status by default. Applications can opt in via setUserDetailsChecker, for example by providing AccountStatusUserDetailsChecker to reject locked, disabled, or expired accounts. Issue spring-projectsgh-17655 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
…nager Add the same opt-in UserDetailsChecker support to OneTimeTokenReactiveAuthenticationManager, mirroring OneTimeTokenAuthenticationProvider for the reactive stack. Issue spring-projectsgh-17655 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
jzheaux
approved these changes
Aug 11, 2026
Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
Collaborator
|
Thanks, @therepanic! This is now merged into |
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.
The main problem is that
OneTimeTokenAuthenticationProviderdoes not extend fromAbstractUserDetailsAuthenticationProvider, which has a preauthentication check for user details. However, we do not need to extend from it because it does not fit the context of the class. In this regard, I decided to add my own checker to this commit, which performs a preauthentication check before authorizing the account, similar to how it is done inAbstractUserDetailsAuthenticationProvider. I also added a test toOneTimeTokenAuthenticationProviderTeststhat identifies this problem.Closes: #17655