Class DefaultOAuth2AuthorizationRequestResolver
- java.lang.Object
-
- org.springframework.security.oauth2.client.web.DefaultOAuth2AuthorizationRequestResolver
-
- All Implemented Interfaces:
OAuth2AuthorizationRequestResolver
public final class DefaultOAuth2AuthorizationRequestResolver extends java.lang.Object implements OAuth2AuthorizationRequestResolver
An implementation of anOAuth2AuthorizationRequestResolverthat attempts to resolve anOAuth2AuthorizationRequestfrom the providedHttpServletRequestusing the default requestURIpattern/oauth2/authorization/{registrationId}.NOTE: The default base
URI/oauth2/authorizationmay be overridden via it's constructorDefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository, String).- Since:
- 5.1
- See Also:
OAuth2AuthorizationRequestResolver,OAuth2AuthorizationRequestRedirectFilter
-
-
Constructor Summary
Constructors Constructor Description DefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository clientRegistrationRepository, java.lang.String authorizationRequestBaseUri)Constructs aDefaultOAuth2AuthorizationRequestResolverusing the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequestresolve(javax.servlet.http.HttpServletRequest request)Returns theOAuth2AuthorizationRequestresolved from the providedHttpServletRequestornullif not available.org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequestresolve(javax.servlet.http.HttpServletRequest request, java.lang.String registrationId)Returns theOAuth2AuthorizationRequestresolved from the providedHttpServletRequestornullif not available.voidsetAuthorizationRequestCustomizer(java.util.function.Consumer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer)Sets theConsumerto be provided theOAuth2AuthorizationRequest.Builderallowing for further customizations.
-
-
-
Constructor Detail
-
DefaultOAuth2AuthorizationRequestResolver
public DefaultOAuth2AuthorizationRequestResolver(ClientRegistrationRepository clientRegistrationRepository, java.lang.String authorizationRequestBaseUri)
Constructs aDefaultOAuth2AuthorizationRequestResolverusing the provided parameters.- Parameters:
clientRegistrationRepository- the repository of client registrationsauthorizationRequestBaseUri- the baseURIused for resolving authorization requests
-
-
Method Detail
-
resolve
public org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest resolve(javax.servlet.http.HttpServletRequest request)
Description copied from interface:OAuth2AuthorizationRequestResolverReturns theOAuth2AuthorizationRequestresolved from the providedHttpServletRequestornullif not available.- Specified by:
resolvein interfaceOAuth2AuthorizationRequestResolver- Parameters:
request- theHttpServletRequest- Returns:
- the resolved
OAuth2AuthorizationRequestornullif not available
-
resolve
public org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest resolve(javax.servlet.http.HttpServletRequest request, java.lang.String registrationId)Description copied from interface:OAuth2AuthorizationRequestResolverReturns theOAuth2AuthorizationRequestresolved from the providedHttpServletRequestornullif not available.- Specified by:
resolvein interfaceOAuth2AuthorizationRequestResolver- Parameters:
request- theHttpServletRequestregistrationId- the clientRegistrationId to use- Returns:
- the resolved
OAuth2AuthorizationRequestornullif not available
-
setAuthorizationRequestCustomizer
public void setAuthorizationRequestCustomizer(java.util.function.Consumer<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest.Builder> authorizationRequestCustomizer)
Sets theConsumerto be provided theOAuth2AuthorizationRequest.Builderallowing for further customizations.- Parameters:
authorizationRequestCustomizer- theConsumerto be provided theOAuth2AuthorizationRequest.Builder- Since:
- 5.3
-
-