Class OAuth2AuthorizationEndpointConfigurer
java.lang.Object
org.springframework.security.oauth2.server.authorization.config.annotation.web.configurers.OAuth2AuthorizationEndpointConfigurer
Configurer for the OAuth 2.0 Authorization Endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOAuth2AuthorizationCodeRequestAuthenticationToken.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.authorizationRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter authorizationRequestConverter) Adds anAuthenticationConverterused when attempting to extract an Authorization Request (or Consent) fromHttpServletRequestto an instance ofOAuth2AuthorizationCodeRequestAuthenticationTokenorOAuth2AuthorizationConsentAuthenticationTokenused for authenticating the request.authorizationRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> authorizationRequestConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.authorizationResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authorizationResponseHandler) Sets theAuthenticationSuccessHandlerused for handling anOAuth2AuthorizationCodeRequestAuthenticationTokenand returning theAuthorization Response.consentPage(String consentPage) Specify the URI to redirect Resource Owners to if consent is required during theauthorization_codeflow.errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthorizationCodeRequestAuthenticationExceptionand returning theError Response.protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object>protected final <T> TpostProcess(T object)
-
Method Details
-
authorizationRequestConverter
public OAuth2AuthorizationEndpointConfigurer authorizationRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter authorizationRequestConverter) Adds anAuthenticationConverterused when attempting to extract an Authorization Request (or Consent) fromHttpServletRequestto an instance ofOAuth2AuthorizationCodeRequestAuthenticationTokenorOAuth2AuthorizationConsentAuthenticationTokenused for authenticating the request.- Parameters:
authorizationRequestConverter- anAuthenticationConverterused when attempting to extract an Authorization Request (or Consent) fromHttpServletRequest- Returns:
- the
OAuth2AuthorizationEndpointConfigurerfor further configuration
-
authorizationRequestConverters
public OAuth2AuthorizationEndpointConfigurer authorizationRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> authorizationRequestConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.- Parameters:
authorizationRequestConvertersConsumer- theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's- Returns:
- the
OAuth2AuthorizationEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
authenticationProvider
public OAuth2AuthorizationEndpointConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOAuth2AuthorizationCodeRequestAuthenticationToken.- Parameters:
authenticationProvider- anAuthenticationProviderused for authenticating anOAuth2AuthorizationCodeRequestAuthenticationToken- Returns:
- the
OAuth2AuthorizationEndpointConfigurerfor further configuration
-
authenticationProviders
public OAuth2AuthorizationEndpointConfigurer 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
OAuth2AuthorizationEndpointConfigurerfor further configuration - Since:
- 0.4.0
-
authorizationResponseHandler
public OAuth2AuthorizationEndpointConfigurer authorizationResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authorizationResponseHandler) Sets theAuthenticationSuccessHandlerused for handling anOAuth2AuthorizationCodeRequestAuthenticationTokenand returning theAuthorization Response.- Parameters:
authorizationResponseHandler- theAuthenticationSuccessHandlerused for handling anOAuth2AuthorizationCodeRequestAuthenticationToken- Returns:
- the
OAuth2AuthorizationEndpointConfigurerfor further configuration
-
errorResponseHandler
public OAuth2AuthorizationEndpointConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthorizationCodeRequestAuthenticationExceptionand returning theError Response.- Parameters:
errorResponseHandler- theAuthenticationFailureHandlerused for handling anOAuth2AuthorizationCodeRequestAuthenticationException- Returns:
- the
OAuth2AuthorizationEndpointConfigurerfor further configuration
-
consentPage
Specify the URI to redirect Resource Owners to if consent is required during theauthorization_codeflow. A default consent page will be generated when this attribute is not specified. If a URI is specified, applications are required to process the specified URI to generate a consent page. The query string will contain the following parameters:client_id- the client identifierscope- a space-delimited list of scopes present in the authorization requeststate- a CSRF protection token
- It must be an HTTP POST
- It must be submitted to
AuthorizationServerSettings.getAuthorizationEndpoint() - It must include the received
client_idas an HTTP parameter - It must include the received
stateas an HTTP parameter - It must include the list of
scopes theResource Ownerconsented to as an HTTP parameter
- Parameters:
consentPage- the URI of the custom consent page to redirect to if consent is required (e.g. "/oauth2/consent")- Returns:
- the
OAuth2AuthorizationEndpointConfigurerfor further configuration
-
postProcess
protected final <T> T postProcess(T object) -
getObjectPostProcessor
protected final org.springframework.security.config.annotation.ObjectPostProcessor<Object> getObjectPostProcessor()
-