public class DefaultServerOAuth2AuthorizationRequestResolver extends java.lang.Object implements ServerOAuth2AuthorizationRequestResolver
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.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_AUTHORIZATION_REQUEST_PATTERN
The default pattern used to resolve the
ClientRegistration.getRegistrationId() |
static java.lang.String |
DEFAULT_REGISTRATION_ID_URI_VARIABLE_NAME
The name of the path variable that contains the
ClientRegistration.getRegistrationId() |
| Constructor and Description |
|---|
DefaultServerOAuth2AuthorizationRequestResolver(ReactiveClientRegistrationRepository clientRegistrationRepository)
Creates a new instance
|
DefaultServerOAuth2AuthorizationRequestResolver(ReactiveClientRegistrationRepository clientRegistrationRepository,
org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher authorizationRequestMatcher)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> |
resolve(org.springframework.web.server.ServerWebExchange exchange)
Returns the
OAuth2AuthorizationRequest resolved from
the provided HttpServletRequest or null if not available. |
reactor.core.publisher.Mono<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> |
resolve(org.springframework.web.server.ServerWebExchange exchange,
java.lang.String clientRegistrationId)
Returns the
OAuth2AuthorizationRequest resolved from
the provided HttpServletRequest or null if not available. |
void |
setAuthorizationRequestCustomizer(java.util.function.Consumer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer)
Sets the
Consumer to be provided the OAuth2AuthorizationRequest.Builder
allowing for further customizations. |
public static final java.lang.String DEFAULT_REGISTRATION_ID_URI_VARIABLE_NAME
ClientRegistration.getRegistrationId()public static final java.lang.String DEFAULT_AUTHORIZATION_REQUEST_PATTERN
ClientRegistration.getRegistrationId()public DefaultServerOAuth2AuthorizationRequestResolver(ReactiveClientRegistrationRepository clientRegistrationRepository)
clientRegistrationRepository - the repository to resolve the ClientRegistrationpublic DefaultServerOAuth2AuthorizationRequestResolver(ReactiveClientRegistrationRepository clientRegistrationRepository, org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher authorizationRequestMatcher)
clientRegistrationRepository - the repository to resolve the ClientRegistrationauthorizationRequestMatcher - the matcher that determines if the request is a match and extracts the
DEFAULT_REGISTRATION_ID_URI_VARIABLE_NAME from the path variables.public reactor.core.publisher.Mono<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> resolve(org.springframework.web.server.ServerWebExchange exchange)
ServerOAuth2AuthorizationRequestResolverOAuth2AuthorizationRequest resolved from
the provided HttpServletRequest or null if not available.resolve in interface ServerOAuth2AuthorizationRequestResolverexchange - the ServerWebExchangeOAuth2AuthorizationRequest or null if not availablepublic reactor.core.publisher.Mono<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> resolve(org.springframework.web.server.ServerWebExchange exchange,
java.lang.String clientRegistrationId)
ServerOAuth2AuthorizationRequestResolverOAuth2AuthorizationRequest resolved from
the provided HttpServletRequest or null if not available.resolve in interface ServerOAuth2AuthorizationRequestResolverexchange - the ServerWebExchangeclientRegistrationId - the client registration idOAuth2AuthorizationRequest or null if not availablepublic final void setAuthorizationRequestCustomizer(java.util.function.Consumer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer)
Consumer to be provided the OAuth2AuthorizationRequest.Builder
allowing for further customizations.authorizationRequestCustomizer - the Consumer to be provided the OAuth2AuthorizationRequest.Builder