Class OAuth2TokenEndpointConfigurer
java.lang.Object
org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2TokenEndpointConfigurer
Configurer for the OAuth 2.0 Token Endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionaccessTokenRequestConverter
(org.springframework.security.web.authentication.AuthenticationConverter accessTokenRequestConverter) Adds anAuthenticationConverter
used when attempting to extract an Access Token Request fromHttpServletRequest
to an instance ofOAuth2AuthorizationGrantAuthenticationToken
used for authenticating the authorization grant.accessTokenRequestConverters
(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> accessTokenRequestConvertersConsumer) Sets theConsumer
providing access to theList
of default and (optionally) addedAuthenticationConverter
's allowing the ability to add, remove, or customize a specificAuthenticationConverter
.accessTokenResponseHandler
(org.springframework.security.web.authentication.AuthenticationSuccessHandler accessTokenResponseHandler) Sets theAuthenticationSuccessHandler
used for handling anOAuth2AccessTokenAuthenticationToken
and returning theAccess Token Response
.authenticationProvider
(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProvider
used for authenticating a type ofOAuth2AuthorizationGrantAuthenticationToken
.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
.errorResponseHandler
(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandler
used for handling anOAuth2AuthenticationException
and returning theError Response
.protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object>
protected final <T> T
postProcess
(T object)
-
Method Details
-
accessTokenRequestConverter
public OAuth2TokenEndpointConfigurer accessTokenRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter accessTokenRequestConverter) Adds anAuthenticationConverter
used when attempting to extract an Access Token Request fromHttpServletRequest
to an instance ofOAuth2AuthorizationGrantAuthenticationToken
used for authenticating the authorization grant.- Parameters:
accessTokenRequestConverter
- anAuthenticationConverter
used when attempting to extract an Access Token Request fromHttpServletRequest
- Returns:
- the
OAuth2TokenEndpointConfigurer
for further configuration
-
accessTokenRequestConverters
public OAuth2TokenEndpointConfigurer accessTokenRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> accessTokenRequestConvertersConsumer) Sets theConsumer
providing access to theList
of default and (optionally) addedAuthenticationConverter
's allowing the ability to add, remove, or customize a specificAuthenticationConverter
.- Parameters:
accessTokenRequestConvertersConsumer
- theConsumer
providing access to theList
of default and (optionally) addedAuthenticationConverter
's- Returns:
- the
OAuth2TokenEndpointConfigurer
for further configuration - Since:
- 0.4.0
-
authenticationProvider
public OAuth2TokenEndpointConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProvider
used for authenticating a type ofOAuth2AuthorizationGrantAuthenticationToken
.- Parameters:
authenticationProvider
- anAuthenticationProvider
used for authenticating a type ofOAuth2AuthorizationGrantAuthenticationToken
- Returns:
- the
OAuth2TokenEndpointConfigurer
for further configuration
-
authenticationProviders
public OAuth2TokenEndpointConfigurer 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
OAuth2TokenEndpointConfigurer
for further configuration - Since:
- 0.4.0
-
accessTokenResponseHandler
public OAuth2TokenEndpointConfigurer accessTokenResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler accessTokenResponseHandler) Sets theAuthenticationSuccessHandler
used for handling anOAuth2AccessTokenAuthenticationToken
and returning theAccess Token Response
.- Parameters:
accessTokenResponseHandler
- theAuthenticationSuccessHandler
used for handling anOAuth2AccessTokenAuthenticationToken
- Returns:
- the
OAuth2TokenEndpointConfigurer
for further configuration
-
errorResponseHandler
public OAuth2TokenEndpointConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandler
used for handling anOAuth2AuthenticationException
and returning theError Response
.- Parameters:
errorResponseHandler
- theAuthenticationFailureHandler
used for handling anOAuth2AuthenticationException
- Returns:
- the
OAuth2TokenEndpointConfigurer
for further configuration
-
postProcess
protected final <T> T postProcess(T object) -
getObjectPostProcessor
protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object> getObjectPostProcessor()
-