@ -80,7 +80,11 @@ If you want to customize the default configuration (regardless of whether you're
@@ -80,7 +80,11 @@ If you want to customize the default configuration (regardless of whether you're
@ -146,7 +146,10 @@ The following listing shows the `Client` entity, which is used to persist inform
@@ -146,7 +146,10 @@ The following listing shows the `Client` entity, which is used to persist inform
@ -155,7 +158,10 @@ The following listing shows the `Authorization` entity, which is used to persist
@@ -155,7 +158,10 @@ The following listing shows the `Authorization` entity, which is used to persist
@ -164,7 +170,10 @@ The following listing shows the `AuthorizationConsent` entity, which is used to
@@ -164,7 +170,10 @@ The following listing shows the `AuthorizationConsent` entity, which is used to
@ -182,7 +191,10 @@ The following listing shows the `ClientRepository`, which is able to find a <<cl
@@ -182,7 +191,10 @@ The following listing shows the `ClientRepository`, which is able to find a <<cl
@ -201,7 +216,10 @@ The following listing shows the `AuthorizationConsentRepository`, which is able
@@ -201,7 +216,10 @@ The following listing shows the `AuthorizationConsentRepository`, which is able
@ -224,7 +242,10 @@ The following listing shows the `JpaRegisteredClientRepository`, which uses a <<
@@ -224,7 +242,10 @@ The following listing shows the `JpaRegisteredClientRepository`, which uses a <<
@ -233,7 +254,10 @@ The following listing shows the `JpaOAuth2AuthorizationService`, which uses an <
@@ -233,7 +254,10 @@ The following listing shows the `JpaOAuth2AuthorizationService`, which uses an <
@ -242,4 +266,7 @@ The following listing shows the `JpaOAuth2AuthorizationConsentService`, which us
@@ -242,4 +266,7 @@ The following listing shows the `JpaOAuth2AuthorizationConsentService`, which us
@ -22,7 +22,10 @@ Before customizing the response, you need to enable the UserInfo endpoint.
@@ -22,7 +22,10 @@ Before customizing the response, you need to enable the UserInfo endpoint.
The following listing shows how to enable the {spring-security-reference-base-url}/servlet/oauth2/resource-server/jwt.html[OAuth2 resource server configuration].
TIP: Click on the "Expand folded text" icon in the code sample above to display the full example.
@ -50,7 +53,10 @@ The preferred way to customize the user info response is to add standard claims
@@ -50,7 +53,10 @@ The preferred way to customize the user info response is to add standard claims
The following listing shows how to add claims to the `id_token`.
@ -70,7 +79,10 @@ The mapper implementation receives an instance of `OidcUserInfoAuthenticationCon
@@ -70,7 +79,10 @@ The mapper implementation receives an instance of `OidcUserInfoAuthenticationCon
The following listing shows how to use the customization option that is available while working directly with the `OAuth2AuthorizationServerConfigurer`.
This configuration maps claims from the access token (which is a JWT when using the xref:{docs-dir}/getting-started.adoc#sample.gettingStarted[Getting Started config]) to populate the user info response and provides the following:
@ -83,6 +95,9 @@ This configuration maps claims from the access token (which is a JWT when using
@@ -83,6 +95,9 @@ This configuration maps claims from the access token (which is a JWT when using
The user info mapper is not limited to mapping claims from a JWT, but this is a simple example that demonstrates the customization option.
Similar to the <<customize-id-token,example shown earlier>> where we customize claims of the ID token, you can customize claims of the access token itself ahead of time, as in the following example:
Whether you customize the user info response directly or use this example and customize the access token, you can look up information in a database, perform an LDAP query, make a request to another service, or use any other means of obtaining the information you want to be presented in the user info response.