Class OAuth2ClientRegistrationEndpointConfigurer
java.lang.Object
org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ClientRegistrationEndpointConfigurer
Configurer for OAuth 2.0 Dynamic Client Registration Endpoint.
- Since:
- 7.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionauthenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOAuth2ClientRegistrationAuthenticationToken.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.clientRegistrationRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter clientRegistrationRequestConverter) Adds anAuthenticationConverterused when attempting to extract a Client Registration Request fromHttpServletRequestto an instance ofOAuth2ClientRegistrationAuthenticationTokenused for authenticating the request.clientRegistrationRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> clientRegistrationRequestConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.clientRegistrationResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler clientRegistrationResponseHandler) Sets theAuthenticationSuccessHandlerused for handling anOAuth2ClientRegistrationAuthenticationTokenand returning theClient Registration Response.errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationExceptionand returning theError Response.protected final ObjectPostProcessor<Object>openRegistrationAllowed(boolean openRegistrationAllowed) Set totrueif open client registration (with no initial access token) is allowed.protected final <T> TpostProcess(T object)
-
Method Details
-
clientRegistrationRequestConverter
public OAuth2ClientRegistrationEndpointConfigurer clientRegistrationRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter clientRegistrationRequestConverter) Adds anAuthenticationConverterused when attempting to extract a Client Registration Request fromHttpServletRequestto an instance ofOAuth2ClientRegistrationAuthenticationTokenused for authenticating the request.- Parameters:
clientRegistrationRequestConverter- anAuthenticationConverterused when attempting to extract a Client Registration Request fromHttpServletRequest- Returns:
- the
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
clientRegistrationRequestConverters
public OAuth2ClientRegistrationEndpointConfigurer clientRegistrationRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> clientRegistrationRequestConvertersConsumer) Sets theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's allowing the ability to add, remove, or customize a specificAuthenticationConverter.- Parameters:
clientRegistrationRequestConvertersConsumer- theConsumerproviding access to theListof default and (optionally) addedAuthenticationConverter's- Returns:
- the
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
authenticationProvider
public OAuth2ClientRegistrationEndpointConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) Adds anAuthenticationProviderused for authenticating anOAuth2ClientRegistrationAuthenticationToken.- Parameters:
authenticationProvider- anAuthenticationProviderused for authenticating anOAuth2ClientRegistrationAuthenticationToken- Returns:
- the
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
authenticationProviders
public OAuth2ClientRegistrationEndpointConfigurer 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
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
clientRegistrationResponseHandler
public OAuth2ClientRegistrationEndpointConfigurer clientRegistrationResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler clientRegistrationResponseHandler) Sets theAuthenticationSuccessHandlerused for handling anOAuth2ClientRegistrationAuthenticationTokenand returning theClient Registration Response.- Parameters:
clientRegistrationResponseHandler- theAuthenticationSuccessHandlerused for handling anOAuth2ClientRegistrationAuthenticationToken- Returns:
- the
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
errorResponseHandler
public OAuth2ClientRegistrationEndpointConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationExceptionand returning theError Response.- Parameters:
errorResponseHandler- theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationException- Returns:
- the
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
openRegistrationAllowed
public OAuth2ClientRegistrationEndpointConfigurer openRegistrationAllowed(boolean openRegistrationAllowed) Set totrueif open client registration (with no initial access token) is allowed. The default isfalse.- Parameters:
openRegistrationAllowed-trueif open client registration is allowed,falseotherwise- Returns:
- the
OAuth2ClientRegistrationEndpointConfigurerfor further configuration
-
postProcess
protected final <T> T postProcess(T object) -
getObjectPostProcessor
-