spring-projects / spring-projects/spring-security

Simplify support of username as a nested property

Open
#16,390 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

For Spring Boot users who want to change the property of the User Info response that is used to create a username, they can easily change this by specifying the user-name-attribute. However, if the username is nested this does not work. For example, X wraps responses in a data property which means the username is data.username

{
  "data": {
    "id": "2244994945",
    "name": "TwitterDev",
    "username": "Twitter Dev"
  }
}

Unfortunately, this currently requires quite a bit more work than a non-nested property.

We could consider a way to access nested properties or to simplify transform the response so it is not nested (probably preferred).

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 by tracing how Spring Security handles the User Info response and the user-name-attribute setting. Reproduce the nested data.username example, then define and implement the chosen approach so a nested username can be used without the current extra work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.