Skip to content
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

Expose user name attribute name in OAuth2UserAuthority #15012

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

filiphr
Copy link
Contributor

@filiphr filiphr commented May 6, 2024

We are using custom GrantedAuthoritiesMapper that is doing some custom loading of attributes based on the OAuth2UserAuthority. We've had some request to do something based on the user name. Currently, there is no easy way to access the configured username attribute name.

The goal of this PR is to expose this information directly in the OAuth2UserAuthority and this make it easy to get the username from the attributes.

An alternative could also be to expose getUserName and just use the userNameAttributeName in the OAuth2UserAuthority.

I hope that you'll consider this PR, if there is anything that you think should be added or done better please let me know

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 6, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants