Skip to content

Which is the role of "username-claim: preferred_username" ? #204

Answered by ch4mpy
rgambelli asked this question in Q&A
Discussion options

You must be logged in to vote

$.preferred_username is a JSON-path to a claim at the root of the JSON payload.

preferred_username is a String that JSON-path can bind to the same thing as $.preferred_username.

spring-addons-starter-oidc uses JSON path to resolve the username in JSON payloads (JWT content or introspection response) but spring-security doesn't. As a consequence:

  • com.c4-soft.springaddons.oidc.ops[x].username-claim can start with $. (it has to if the target claim is a nested claim)
  • spring.security.oauth2.client.provider.my-provider.user-name-attribute must not start with $. but can target only claims at the root of the payload (not nested ones)

What I did lately in apps being both a client with oauth2Login

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rgambelli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants