Class OAuth2ClientRegistrationEndpointConfigurer

java.lang.Object
org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2ClientRegistrationEndpointConfigurer

public final class OAuth2ClientRegistrationEndpointConfigurer extends Object
Configurer for OAuth 2.0 Dynamic Client Registration Endpoint.
Since:
7.0
See Also:
  • Method Details

    • clientRegistrationRequestConverter

      public OAuth2ClientRegistrationEndpointConfigurer clientRegistrationRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter clientRegistrationRequestConverter)
      Adds an AuthenticationConverter used when attempting to extract a Client Registration Request from HttpServletRequest to an instance of OAuth2ClientRegistrationAuthenticationToken used for authenticating the request.
      Parameters:
      clientRegistrationRequestConverter - an AuthenticationConverter used when attempting to extract a Client Registration Request from HttpServletRequest
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • clientRegistrationRequestConverters

      public OAuth2ClientRegistrationEndpointConfigurer clientRegistrationRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> clientRegistrationRequestConvertersConsumer)
      Sets the Consumer providing access to the List of default and (optionally) added AuthenticationConverter's allowing the ability to add, remove, or customize a specific AuthenticationConverter.
      Parameters:
      clientRegistrationRequestConvertersConsumer - the Consumer providing access to the List of default and (optionally) added AuthenticationConverter's
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • authenticationProvider

      public OAuth2ClientRegistrationEndpointConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider)
      Adds an AuthenticationProvider used for authenticating an OAuth2ClientRegistrationAuthenticationToken.
      Parameters:
      authenticationProvider - an AuthenticationProvider used for authenticating an OAuth2ClientRegistrationAuthenticationToken
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • authenticationProviders

      public OAuth2ClientRegistrationEndpointConfigurer authenticationProviders(Consumer<List<org.springframework.security.authentication.AuthenticationProvider>> authenticationProvidersConsumer)
      Sets the Consumer providing access to the List of default and (optionally) added AuthenticationProvider's allowing the ability to add, remove, or customize a specific AuthenticationProvider.
      Parameters:
      authenticationProvidersConsumer - the Consumer providing access to the List of default and (optionally) added AuthenticationProvider's
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • clientRegistrationResponseHandler

      public OAuth2ClientRegistrationEndpointConfigurer clientRegistrationResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler clientRegistrationResponseHandler)
      Sets the AuthenticationSuccessHandler used for handling an OAuth2ClientRegistrationAuthenticationToken and returning the Client Registration Response.
      Parameters:
      clientRegistrationResponseHandler - the AuthenticationSuccessHandler used for handling an OAuth2ClientRegistrationAuthenticationToken
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • errorResponseHandler

      public OAuth2ClientRegistrationEndpointConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler)
      Sets the AuthenticationFailureHandler used for handling an OAuth2AuthenticationException and returning the Error Response.
      Parameters:
      errorResponseHandler - the AuthenticationFailureHandler used for handling an OAuth2AuthenticationException
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • openRegistrationAllowed

      public OAuth2ClientRegistrationEndpointConfigurer openRegistrationAllowed(boolean openRegistrationAllowed)
      Set to true if open client registration (with no initial access token) is allowed. The default is false.
      Parameters:
      openRegistrationAllowed - true if open client registration is allowed, false otherwise
      Returns:
      the OAuth2ClientRegistrationEndpointConfigurer for further configuration
    • postProcess

      protected final <T> T postProcess(T object)
    • getObjectPostProcessor

      protected final ObjectPostProcessor<Object> getObjectPostProcessor()