Class OidcUserInfoEndpointConfigurer
java.lang.Object
org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OidcUserInfoEndpointConfigurer
Configurer for OpenID Connect 1.0 UserInfo Endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOidcUserInfoAuthenticationToken.authenticationProviders(Consumer<List<org.springframework.security.authentication.AuthenticationProvider>> authenticationProvidersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationProvider's allowing the ability to add, remove, or customize a specificAuthenticationProvider.errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationExceptionand returning theError Response.protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object>protected final <T> TpostProcess(T object) userInfoMapper(Function<OidcUserInfoAuthenticationContext, org.springframework.security.oauth2.core.oidc.OidcUserInfo> userInfoMapper) Sets theFunctionused to extract claims fromOidcUserInfoAuthenticationContextto an instance ofOidcUserInfofor the UserInfo response.userInfoRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter userInfoRequestConverter) Adds anAuthenticationConverterused when attempting to extract an UserInfo Request fromHttpServletRequestto an instance ofOidcUserInfoAuthenticationTokenused for authenticating the request.userInfoRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> userInfoRequestConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.userInfoResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler userInfoResponseHandler) Sets theAuthenticationSuccessHandlerused for handling anOidcUserInfoAuthenticationTokenand returning theUserInfo Response.
-
Method Details
-
userInfoRequestConverter
public OidcUserInfoEndpointConfigurer userInfoRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter userInfoRequestConverter) Adds anAuthenticationConverterused when attempting to extract an UserInfo Request fromHttpServletRequestto an instance ofOidcUserInfoAuthenticationTokenused for authenticating the request.- Parameters:
userInfoRequestConverter- anAuthenticationConverterused when attempting to extract an UserInfo Request fromHttpServletRequest- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
userInfoRequestConverters
public OidcUserInfoEndpointConfigurer userInfoRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> userInfoRequestConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.- Parameters:
userInfoRequestConvertersConsumer- theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
authenticationProvider
public OidcUserInfoEndpointConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOidcUserInfoAuthenticationToken.- Parameters:
authenticationProvider- anAuthenticationProviderused for authenticating anOidcUserInfoAuthenticationToken- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
authenticationProviders
public OidcUserInfoEndpointConfigurer authenticationProviders(Consumer<List<org.springframework.security.authentication.AuthenticationProvider>> authenticationProvidersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationProvider's allowing the ability to add, remove, or customize a specificAuthenticationProvider.- Parameters:
authenticationProvidersConsumer- theConsumerproviding access to theListof default and (optionally) addedAuthenticationProvider's- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
userInfoResponseHandler
public OidcUserInfoEndpointConfigurer userInfoResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler userInfoResponseHandler) Sets theAuthenticationSuccessHandlerused for handling anOidcUserInfoAuthenticationTokenand returning theUserInfo Response.- Parameters:
userInfoResponseHandler- theAuthenticationSuccessHandlerused for handling anOidcUserInfoAuthenticationToken- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
errorResponseHandler
public OidcUserInfoEndpointConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationExceptionand returning theError Response.- Parameters:
errorResponseHandler- theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationException- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
userInfoMapper
public OidcUserInfoEndpointConfigurer userInfoMapper(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- Returns:
- the
OidcUserInfoEndpointConfigurerfor further configuration
-
postProcess
protected final <T> T postProcess(T object) -
getObjectPostProcessor
protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object> getObjectPostProcessor()
-