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 anAuthenticationConverter
used when attempting to extract client credentials fromHttpServletRequest
to an instance ofOAuth2ClientAuthenticationToken
used for authenticating the client.authenticationConverters
(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> authenticationConvertersConsumer) Sets theConsumer
providing access to theList
of default and (optionally) addedAuthenticationConverter
's allowing the ability to add, remove, or customize a specificAuthenticationConverter
.authenticationProvider
(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProvider
used for authenticating anOAuth2ClientAuthenticationToken
.authenticationProviders
(Consumer<List<org.springframework.security.authentication.AuthenticationProvider>> authenticationProvidersConsumer) Sets theConsumer
providing access to theList
of default and (optionally) addedAuthenticationProvider
's allowing the ability to add, remove, or customize a specificAuthenticationProvider
.authenticationSuccessHandler
(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler) Sets theAuthenticationSuccessHandler
used for handling a successful client authentication and associating theOAuth2ClientAuthenticationToken
to theSecurityContext
.errorResponseHandler
(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandler
used for handling a failed client authentication and returning theError Response
.protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object>
protected final <T> T
postProcess
(T object)
-
Method Details
-
authenticationConverter
public OAuth2ClientAuthenticationConfigurer authenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter) Adds anAuthenticationConverter
used when attempting to extract client credentials fromHttpServletRequest
to an instance ofOAuth2ClientAuthenticationToken
used for authenticating the client.- Parameters:
authenticationConverter
- anAuthenticationConverter
used when attempting to extract client credentials fromHttpServletRequest
- Returns:
- the
OAuth2ClientAuthenticationConfigurer
for further configuration
-
authenticationConverters
public OAuth2ClientAuthenticationConfigurer authenticationConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> authenticationConvertersConsumer) Sets theConsumer
providing access to theList
of default and (optionally) addedAuthenticationConverter
's allowing the ability to add, remove, or customize a specificAuthenticationConverter
.- Parameters:
authenticationConvertersConsumer
- theConsumer
providing access to theList
of default and (optionally) addedAuthenticationConverter
's- Returns:
- the
OAuth2ClientAuthenticationConfigurer
for further configuration - Since:
- 0.4.0
-
authenticationProvider
public OAuth2ClientAuthenticationConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProvider
used for authenticating anOAuth2ClientAuthenticationToken
.- Parameters:
authenticationProvider
- anAuthenticationProvider
used for authenticating anOAuth2ClientAuthenticationToken
- Returns:
- the
OAuth2ClientAuthenticationConfigurer
for further configuration
-
authenticationProviders
public OAuth2ClientAuthenticationConfigurer authenticationProviders(Consumer<List<org.springframework.security.authentication.AuthenticationProvider>> authenticationProvidersConsumer) Sets theConsumer
providing access to theList
of default and (optionally) addedAuthenticationProvider
's allowing the ability to add, remove, or customize a specificAuthenticationProvider
.- Parameters:
authenticationProvidersConsumer
- theConsumer
providing access to theList
of default and (optionally) addedAuthenticationProvider
's- Returns:
- the
OAuth2ClientAuthenticationConfigurer
for further configuration - Since:
- 0.4.0
-
authenticationSuccessHandler
public OAuth2ClientAuthenticationConfigurer authenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler) Sets theAuthenticationSuccessHandler
used for handling a successful client authentication and associating theOAuth2ClientAuthenticationToken
to theSecurityContext
.- Parameters:
authenticationSuccessHandler
- theAuthenticationSuccessHandler
used for handling a successful client authentication- Returns:
- the
OAuth2ClientAuthenticationConfigurer
for further configuration
-
errorResponseHandler
public OAuth2ClientAuthenticationConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandler
used for handling a failed client authentication and returning theError Response
.- Parameters:
errorResponseHandler
- theAuthenticationFailureHandler
used for handling a failed client authentication- Returns:
- the
OAuth2ClientAuthenticationConfigurer
for further configuration
-
postProcess
protected final <T> T postProcess(T object) -
getObjectPostProcessor
protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object> getObjectPostProcessor()
-