public final class OidcUserInfoAuthenticationProvider
extends java.lang.Object
implements org.springframework.security.authentication.AuthenticationProvider
AuthenticationProvider implementation for OpenID Connect 1.0 UserInfo Endpoint.OAuth2AuthorizationService,
5.3. UserInfo Endpoint| Constructor and Description |
|---|
OidcUserInfoAuthenticationProvider(OAuth2AuthorizationService authorizationService)
Constructs an
OidcUserInfoAuthenticationProvider using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication) |
void |
setUserInfoMapper(java.util.function.Function<OidcUserInfoAuthenticationContext,org.springframework.security.oauth2.core.oidc.OidcUserInfo> userInfoMapper)
Sets the
Function used to extract claims from OidcUserInfoAuthenticationContext
to an instance of OidcUserInfo for the UserInfo response. |
boolean |
supports(java.lang.Class<?> authentication) |
public OidcUserInfoAuthenticationProvider(OAuth2AuthorizationService authorizationService)
OidcUserInfoAuthenticationProvider using the provided parameters.authorizationService - the authorization servicepublic org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
authenticate in interface org.springframework.security.authentication.AuthenticationProviderorg.springframework.security.core.AuthenticationExceptionpublic boolean supports(java.lang.Class<?> authentication)
supports in interface org.springframework.security.authentication.AuthenticationProviderpublic void setUserInfoMapper(java.util.function.Function<OidcUserInfoAuthenticationContext,org.springframework.security.oauth2.core.oidc.OidcUserInfo> userInfoMapper)
Function used to extract claims from OidcUserInfoAuthenticationContext
to an instance of OidcUserInfo for the UserInfo response.
The OidcUserInfoAuthenticationContext gives the mapper access to the OidcUserInfoAuthenticationToken,
as well as, the following context attributes:
OidcUserInfoAuthenticationContext.getAccessToken() containing the bearer token used to make the request.OidcUserInfoAuthenticationContext.getAuthorization() containing the OidcIdToken and
OAuth2AccessToken associated with the bearer token used to make the request.userInfoMapper - the Function used to extract claims from OidcUserInfoAuthenticationContext to an instance of OidcUserInfo