Skip to content

Add support one-time token value customization #16939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
franticticktick opened this issue Apr 15, 2025 · 4 comments · May be fixed by #16946
Open

Add support one-time token value customization #16939

franticticktick opened this issue Apr 15, 2025 · 4 comments · May be fixed by #16946
Labels
status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement

Comments

@franticticktick
Copy link
Contributor

It is necessary to add the ability to customize the generation of the one-time token value. Now it is:

String token = UUID.randomUUID().toString();
@franticticktick franticticktick added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Apr 15, 2025
@evgeniycheban
Copy link
Contributor

evgeniycheban commented Apr 15, 2025

I think we could introduce a OneTimeTokenProvider interface with default implementation that uses UUID to generate one time tokens, I can prepare a draft PR.

@franticticktick
Copy link
Contributor Author

Hi @evgeniycheban , thanks for the suggestion. We already have a DefaultGenerateOneTimeTokenRequestResolver. I am considering adding token value customization to this component. For example, setTokenValueFactory or something like that

@evgeniycheban
Copy link
Contributor

Yes, that would make sense to add it to GenerateOneTimeTokenRequest, I think setTokenValueFactory may accept a Supplier<String> or maybe it is worth introducing a dedicated interface for that.

@evgeniycheban
Copy link
Contributor

@franticticktick would you be able to submit a PR or I can take this one?

franticticktick added a commit to franticticktick/spring-security that referenced this issue Apr 16, 2025
franticticktick added a commit to franticticktick/spring-security that referenced this issue Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants