Class OidcUserInfoAuthenticationProvider
java.lang.Object
org.springframework.security.oauth2.server.authorization.oidc.authentication.OidcUserInfoAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public final class OidcUserInfoAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
An
AuthenticationProvider implementation for OpenID Connect 1.0 UserInfo
Endpoint.- Since:
- 0.2.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOidcUserInfoAuthenticationProvider(OAuth2AuthorizationService authorizationService) Constructs anOidcUserInfoAuthenticationProviderusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) voidsetUserInfoMapper(Function<OidcUserInfoAuthenticationContext, org.springframework.security.oauth2.core.oidc.OidcUserInfo> userInfoMapper) Sets theFunctionused to extract claims fromOidcUserInfoAuthenticationContextto an instance ofOidcUserInfofor the UserInfo response.boolean
-
Constructor Details
-
OidcUserInfoAuthenticationProvider
Constructs anOidcUserInfoAuthenticationProviderusing the provided parameters.- Parameters:
authorizationService- the authorization service
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
supports
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-
setUserInfoMapper
public void setUserInfoMapper(Function<OidcUserInfoAuthenticationContext, org.springframework.security.oauth2.core.oidc.OidcUserInfo> userInfoMapper) Sets theFunctionused to extract claims fromOidcUserInfoAuthenticationContextto an instance ofOidcUserInfofor the UserInfo response.The
OidcUserInfoAuthenticationContextgives the mapper access to theOidcUserInfoAuthenticationToken, as well as, the following context attributes:OidcUserInfoAuthenticationContext.getAccessToken()containing the bearer token used to make the request.OidcUserInfoAuthenticationContext.getAuthorization()containing theOidcIdTokenandOAuth2AccessTokenassociated with the bearer token used to make the request.
- Parameters:
userInfoMapper- theFunctionused to extract claims fromOidcUserInfoAuthenticationContextto an instance ofOidcUserInfo
-