spring-projects / spring-projects/spring-security

Oidc(ReactiveOAuth2)UserService uses userNameAttributeName when user info endpoint not invoked

Open
#17,627 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: oauth2 type: bug
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

The property UserInfoEndpoint.userNameAttributeName is used to resolve the username from the even when the user info endpoint is not invoked (imperative / reactive).

The attribute should either:

  1. Only be used when the user info endpoint is invoked (when not invoked it would always use IdTokenClaimNames.SUB). This would be a breaking change or
  2. Be relocated to a place that is not specific to the user info endpoint. In this case, we could address this at the same time as the deprecation in gh-16857

Note that this decision blocks gh-16857 since the usernameExpression might need moved off of the UserInfoEndpoint.

cc @jgrandja

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with UserInfoEndpoint.userNameAttributeName in ClientRegistration.java and compare its use in OidcUserRequestUtils.java, OidcUserService.java, and OidcReactiveOAuth2UserService.java. Review the linked gh-16857 deprecation context and decide whether the attribute remains user-info-specific or moves elsewhere. Done means the chosen behavior is defined for both imperative and reactive paths and gh-16857 is unblocked.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.