Class DefaultServerOAuth2AuthorizationRequestResolver

java.lang.Object
org.springframework.security.oauth2.client.web.server.DefaultServerOAuth2AuthorizationRequestResolver
All Implemented Interfaces:
ServerOAuth2AuthorizationRequestResolver

public class DefaultServerOAuth2AuthorizationRequestResolver extends Object implements ServerOAuth2AuthorizationRequestResolver
The default implementation of ServerOAuth2AuthorizationRequestResolver. The ClientRegistration.getRegistrationId() is extracted from the request using the DEFAULT_AUTHORIZATION_REQUEST_PATTERN. The injected ReactiveClientRegistrationRepository is then used to resolve the ClientRegistration and create the OAuth2AuthorizationRequest.
Since:
5.1
  • Field Details

  • Constructor Details

    • DefaultServerOAuth2AuthorizationRequestResolver

      public DefaultServerOAuth2AuthorizationRequestResolver(ReactiveClientRegistrationRepository clientRegistrationRepository)
      Creates a new instance
      Parameters:
      clientRegistrationRepository - the repository to resolve the ClientRegistration
    • DefaultServerOAuth2AuthorizationRequestResolver

      public DefaultServerOAuth2AuthorizationRequestResolver(ReactiveClientRegistrationRepository clientRegistrationRepository, org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher authorizationRequestMatcher)
      Creates a new instance
      Parameters:
      clientRegistrationRepository - the repository to resolve the ClientRegistration
      authorizationRequestMatcher - the matcher that determines if the request is a match and extracts the DEFAULT_REGISTRATION_ID_URI_VARIABLE_NAME from the path variables.
  • Method Details

    • resolve

      public reactor.core.publisher.Mono<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> resolve(org.springframework.web.server.ServerWebExchange exchange)
      Description copied from interface: ServerOAuth2AuthorizationRequestResolver
      Returns the OAuth2AuthorizationRequest resolved from the provided HttpServletRequest or null if not available.
      Specified by:
      resolve in interface ServerOAuth2AuthorizationRequestResolver
      Parameters:
      exchange - the ServerWebExchange
      Returns:
      the resolved OAuth2AuthorizationRequest or null if not available
    • resolve

      public reactor.core.publisher.Mono<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> resolve(org.springframework.web.server.ServerWebExchange exchange, String clientRegistrationId)
      Description copied from interface: ServerOAuth2AuthorizationRequestResolver
      Returns the OAuth2AuthorizationRequest resolved from the provided HttpServletRequest or null if not available.
      Specified by:
      resolve in interface ServerOAuth2AuthorizationRequestResolver
      Parameters:
      exchange - the ServerWebExchange
      clientRegistrationId - the client registration id
      Returns:
      the resolved OAuth2AuthorizationRequest or null if not available
    • setAuthorizationRequestCustomizer

      public final void setAuthorizationRequestCustomizer(Consumer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer)
      Sets the Consumer to be provided the OAuth2AuthorizationRequest.Builder allowing for further customizations.
      Parameters:
      authorizationRequestCustomizer - the Consumer to be provided the OAuth2AuthorizationRequest.Builder
      Since:
      5.3
      See Also: