Class DefaultOAuth2AuthorizationRequestResolver
java.lang.Object
org.springframework.security.oauth2.client.web.DefaultOAuth2AuthorizationRequestResolver
- All Implemented Interfaces:
OAuth2AuthorizationRequestResolver
public final class DefaultOAuth2AuthorizationRequestResolver
extends Object
implements OAuth2AuthorizationRequestResolver
An implementation of an
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)
.
- Since:
- 5.1
- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultOAuth2AuthorizationRequestResolver
(ClientRegistrationRepository clientRegistrationRepository, String authorizationRequestBaseUri) Constructs aDefaultOAuth2AuthorizationRequestResolver
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(jakarta.servlet.http.HttpServletRequest request) Returns theOAuth2AuthorizationRequest
resolved from the providedHttpServletRequest
ornull
if not available.Returns theOAuth2AuthorizationRequest
resolved from the providedHttpServletRequest
ornull
if not available.void
setAuthorizationRequestCustomizer
(Consumer<OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer) Sets theConsumer
to be provided theOAuth2AuthorizationRequest.Builder
allowing for further customizations.
-
Constructor Details
-
DefaultOAuth2AuthorizationRequestResolver
public DefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository clientRegistrationRepository, String authorizationRequestBaseUri) Constructs aDefaultOAuth2AuthorizationRequestResolver
using the provided parameters.- Parameters:
clientRegistrationRepository
- the repository of client registrationsauthorizationRequestBaseUri
- the baseURI
used for resolving authorization requests
-
-
Method Details
-
resolve
Description copied from interface:OAuth2AuthorizationRequestResolver
Returns theOAuth2AuthorizationRequest
resolved from the providedHttpServletRequest
ornull
if not available.- Specified by:
resolve
in interfaceOAuth2AuthorizationRequestResolver
- Parameters:
request
- theHttpServletRequest
- Returns:
- the resolved
OAuth2AuthorizationRequest
ornull
if not available
-
resolve
public OAuth2AuthorizationRequest resolve(jakarta.servlet.http.HttpServletRequest request, String registrationId) Description copied from interface:OAuth2AuthorizationRequestResolver
Returns theOAuth2AuthorizationRequest
resolved from the providedHttpServletRequest
ornull
if not available.- Specified by:
resolve
in interfaceOAuth2AuthorizationRequestResolver
- Parameters:
request
- theHttpServletRequest
registrationId
- the clientRegistrationId to use- Returns:
- the resolved
OAuth2AuthorizationRequest
ornull
if not available
-
setAuthorizationRequestCustomizer
public void setAuthorizationRequestCustomizer(Consumer<OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer) Sets theConsumer
to be provided theOAuth2AuthorizationRequest.Builder
allowing for further customizations.- Parameters:
authorizationRequestCustomizer
- theConsumer
to be provided theOAuth2AuthorizationRequest.Builder
- Since:
- 5.3
- See Also:
-