public final class DefaultOAuth2AuthorizationRequestResolver extends java.lang.Object implements OAuth2AuthorizationRequestResolver
OAuth2AuthorizationRequestResolver that attempts to
resolve an OAuth2AuthorizationRequest from the provided
HttpServletRequest using the default request URI pattern
/oauth2/authorization/{registrationId}.
NOTE: The default base URI /oauth2/authorization may be
overridden via it's constructor
DefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository, String).
OAuth2AuthorizationRequestResolver,
OAuth2AuthorizationRequestRedirectFilter| Constructor and Description |
|---|
DefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository clientRegistrationRepository,
java.lang.String authorizationRequestBaseUri)
Constructs a
DefaultOAuth2AuthorizationRequestResolver using the provided
parameters. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest |
resolve(javax.servlet.http.HttpServletRequest request)
Returns the
OAuth2AuthorizationRequest resolved from the provided
HttpServletRequest or null if not available. |
org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest |
resolve(javax.servlet.http.HttpServletRequest request,
java.lang.String registrationId)
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 DefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository clientRegistrationRepository, java.lang.String authorizationRequestBaseUri)
DefaultOAuth2AuthorizationRequestResolver using the provided
parameters.clientRegistrationRepository - the repository of client registrationsauthorizationRequestBaseUri - the base URI used for resolving
authorization requestspublic org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest resolve(javax.servlet.http.HttpServletRequest request)
OAuth2AuthorizationRequestResolverOAuth2AuthorizationRequest resolved from the provided
HttpServletRequest or null if not available.resolve in interface OAuth2AuthorizationRequestResolverrequest - the HttpServletRequestOAuth2AuthorizationRequest or null if not
availablepublic org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest resolve(javax.servlet.http.HttpServletRequest request,
java.lang.String registrationId)
OAuth2AuthorizationRequestResolverOAuth2AuthorizationRequest resolved from the provided
HttpServletRequest or null if not available.resolve in interface OAuth2AuthorizationRequestResolverrequest - the HttpServletRequestregistrationId - the clientRegistrationId to useOAuth2AuthorizationRequest or null if not
availablepublic 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