public class OAuth2AuthorizationRequestRedirectWebFilter
extends java.lang.Object
implements org.springframework.web.server.WebFilter
WebFilter
initiates 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
URI
to the Authorization Endpoint. The redirect URI
will 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 Filter
responds to authorization requests at the URI
/oauth2/authorization/{registrationId}
. The URI
template variable
{registrationId}
represents the registration identifier
of the client that is used for initiating the OAuth 2.0
Authorization Request.
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 and Description |
---|
OAuth2AuthorizationRequestRedirectWebFilter(ReactiveClientRegistrationRepository clientRegistrationRepository)
Constructs an
OAuth2AuthorizationRequestRedirectFilter using the provided
parameters. |
OAuth2AuthorizationRequestRedirectWebFilter(ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver)
Constructs an
OAuth2AuthorizationRequestRedirectFilter using the provided
parameters. |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<java.lang.Void> |
filter(org.springframework.web.server.ServerWebExchange exchange,
org.springframework.web.server.WebFilterChain chain) |
void |
setAuthorizationRequestRepository(ServerAuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository)
Sets the repository used for storing
OAuth2AuthorizationRequest 's. |
void |
setRequestCache(ServerRequestCache requestCache)
The request cache to use to save the request before sending a redirect.
|
public OAuth2AuthorizationRequestRedirectWebFilter(ReactiveClientRegistrationRepository clientRegistrationRepository)
OAuth2AuthorizationRequestRedirectFilter
using the provided
parameters.clientRegistrationRepository
- the repository of client registrationspublic OAuth2AuthorizationRequestRedirectWebFilter(ServerOAuth2AuthorizationRequestResolver authorizationRequestResolver)
OAuth2AuthorizationRequestRedirectFilter
using the provided
parameters.authorizationRequestResolver
- the resolver to usepublic final void setAuthorizationRequestRepository(ServerAuthorizationRequestRepository<OAuth2AuthorizationRequest> authorizationRequestRepository)
OAuth2AuthorizationRequest
's.authorizationRequestRepository
- the repository used for storing
OAuth2AuthorizationRequest
'spublic void setRequestCache(ServerRequestCache requestCache)
requestCache
- the cache to redirect to.public reactor.core.publisher.Mono<java.lang.Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)
filter
in interface org.springframework.web.server.WebFilter