Class OAuth2ClientAuthenticationConfigurer
java.lang.Object
org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2ClientAuthenticationConfigurer
Configurer for OAuth 2.0 Client Authentication.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter) Adds anAuthenticationConverterused when attempting to extract client credentials fromHttpServletRequestto an instance ofOAuth2ClientAuthenticationTokenused for authenticating the client.authenticationConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> authenticationConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOAuth2ClientAuthenticationToken.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.authenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler) Sets theAuthenticationSuccessHandlerused for handling a successful client authentication and associating theOAuth2ClientAuthenticationTokento theSecurityContext.errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling a failed client authentication and returning theError Response.protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object>protected final <T> TpostProcess(T object)
-
Method Details
-
authenticationConverter
public OAuth2ClientAuthenticationConfigurer authenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter) Adds anAuthenticationConverterused when attempting to extract client credentials fromHttpServletRequestto an instance ofOAuth2ClientAuthenticationTokenused for authenticating the client.- Parameters:
authenticationConverter- anAuthenticationConverterused when attempting to extract client credentials fromHttpServletRequest- Returns:
- the
OAuth2ClientAuthenticationConfigurerfor further configuration
-
authenticationConverters
public OAuth2ClientAuthenticationConfigurer authenticationConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> authenticationConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.- Parameters:
authenticationConvertersConsumer- theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's- Returns:
- the
OAuth2ClientAuthenticationConfigurerfor further configuration - Since:
- 0.4.0
-
authenticationProvider
public OAuth2ClientAuthenticationConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOAuth2ClientAuthenticationToken.- Parameters:
authenticationProvider- anAuthenticationProviderused for authenticating anOAuth2ClientAuthenticationToken- Returns:
- the
OAuth2ClientAuthenticationConfigurerfor further configuration
-
authenticationProviders
public OAuth2ClientAuthenticationConfigurer 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
OAuth2ClientAuthenticationConfigurerfor further configuration - Since:
- 0.4.0
-
authenticationSuccessHandler
public OAuth2ClientAuthenticationConfigurer authenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler) Sets theAuthenticationSuccessHandlerused for handling a successful client authentication and associating theOAuth2ClientAuthenticationTokento theSecurityContext.- Parameters:
authenticationSuccessHandler- theAuthenticationSuccessHandlerused for handling a successful client authentication- Returns:
- the
OAuth2ClientAuthenticationConfigurerfor further configuration
-
errorResponseHandler
public OAuth2ClientAuthenticationConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling a failed client authentication and returning theError Response.- Parameters:
errorResponseHandler- theAuthenticationFailureHandlerused for handling a failed client authentication- Returns:
- the
OAuth2ClientAuthenticationConfigurerfor further configuration
-
postProcess
protected final <T> T postProcess(T object) -
getObjectPostProcessor
protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object> getObjectPostProcessor()
-