Class OAuth2AuthorizationRequestRedirectWebFilter
- java.lang.Object
-
- org.springframework.security.oauth2.client.web.server.OAuth2AuthorizationRequestRedirectWebFilter
-
- All Implemented Interfaces:
org.springframework.web.server.WebFilter
public class OAuth2AuthorizationRequestRedirectWebFilter extends java.lang.Object implements org.springframework.web.server.WebFilterThisWebFilterinitiates the authorization code grant or implicit grant flow by redirecting the End-User's user-agent to the Authorization Server's Authorization Endpoint.It builds the OAuth 2.0 Authorization Request, which is used as the redirect
URIto the Authorization Endpoint. The redirectURIwill include the client identifier, requested scope(s), state, response type, and a redirection URI which the authorization server will send the user-agent back to once access is granted (or denied) by the End-User (Resource Owner).By default, this
Filterresponds to authorization requests at theURI/oauth2/authorization/{registrationId}. TheURItemplate variable{registrationId}represents theregistration identifierof the client that is used for initiating the OAuth 2.0 Authorization Request.- Since:
- 5.1
- See Also:
OAuth2AuthorizationRequest,AuthorizationRequestRepository,ClientRegistration,ClientRegistrationRepository, Section 4.1 Authorization Code Grant, Section 4.1.1 Authorization Request (Authorization Code), Section 4.2 Implicit Grant, Section 4.2.1 Authorization Request (Implicit)
-
-
Constructor Summary
Constructors Constructor Description OAuth2AuthorizationRequestRedirectWebFilter(ReactiveClientRegistrationRepository clientRegistrationRepository)Constructs anOAuth2AuthorizationRequestRedirectFilterusing the provided parameters.OAuth2AuthorizationRequestRedirectWebFilter(ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver)Constructs anOAuth2AuthorizationRequestRedirectFilterusing the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<java.lang.Void>filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)voidsetAuthorizationRequestRepository(ServerAuthorizationRequestRepository<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> authorizationRequestRepository)Sets the repository used for storingOAuth2AuthorizationRequest's.voidsetRequestCache(org.springframework.security.web.server.savedrequest.ServerRequestCache requestCache)The request cache to use to save the request before sending a redirect.
-
-
-
Constructor Detail
-
OAuth2AuthorizationRequestRedirectWebFilter
public OAuth2AuthorizationRequestRedirectWebFilter(ReactiveClientRegistrationRepository clientRegistrationRepository)
Constructs anOAuth2AuthorizationRequestRedirectFilterusing the provided parameters.- Parameters:
clientRegistrationRepository- the repository of client registrations
-
OAuth2AuthorizationRequestRedirectWebFilter
public OAuth2AuthorizationRequestRedirectWebFilter(ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver)
Constructs anOAuth2AuthorizationRequestRedirectFilterusing the provided parameters.- Parameters:
authorizationRequestResolver- the resolver to use
-
-
Method Detail
-
setAuthorizationRequestRepository
public final void setAuthorizationRequestRepository(ServerAuthorizationRequestRepository<org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest> authorizationRequestRepository)
Sets the repository used for storingOAuth2AuthorizationRequest's.- Parameters:
authorizationRequestRepository- the repository used for storingOAuth2AuthorizationRequest's
-
setRequestCache
public void setRequestCache(org.springframework.security.web.server.savedrequest.ServerRequestCache requestCache)
The request cache to use to save the request before sending a redirect.- Parameters:
requestCache- the cache to redirect to.
-
filter
public reactor.core.publisher.Mono<java.lang.Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)- Specified by:
filterin interfaceorg.springframework.web.server.WebFilter
-
-