Class AbstractWebClientReactiveOAuth2AccessTokenResponseClient<T extends AbstractOAuth2AuthorizationGrantRequest>
- java.lang.Object
-
- org.springframework.security.oauth2.client.endpoint.AbstractWebClientReactiveOAuth2AccessTokenResponseClient<T>
-
- Type Parameters:
T
- type of grant request
- All Implemented Interfaces:
ReactiveOAuth2AccessTokenResponseClient<T>
- Direct Known Subclasses:
WebClientReactiveAuthorizationCodeTokenResponseClient
,WebClientReactiveClientCredentialsTokenResponseClient
,WebClientReactiveJwtBearerTokenResponseClient
,WebClientReactivePasswordTokenResponseClient
,WebClientReactiveRefreshTokenTokenResponseClient
public abstract class AbstractWebClientReactiveOAuth2AccessTokenResponseClient<T extends AbstractOAuth2AuthorizationGrantRequest> extends java.lang.Object implements ReactiveOAuth2AccessTokenResponseClient<T>
Abstract base class for all of theWebClientReactive*TokenResponseClient
s that communicate to the Authorization Server's Token Endpoint.Submits a form request body specific to the type of grant request.
Accepts a JSON response body containing an OAuth 2.0 Access token or error.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeadersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.http.HttpHeaders> headersConverter)
Add (compose) the providedheadersConverter
to the currentConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aHttpHeaders
used in the OAuth 2.0 Access Token Request headers.void
addParametersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>> parametersConverter)
Add (compose) the providedparametersConverter
to the currentConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aMultiValueMap
used in the OAuth 2.0 Access Token Request body.reactor.core.publisher.Mono<OAuth2AccessTokenResponse>
getTokenResponse(T grantRequest)
Exchanges the authorization grant credential, provided in the authorization grant request, for an access token credential at the Authorization Server's Token Endpoint.void
setBodyExtractor(org.springframework.web.reactive.function.BodyExtractor<reactor.core.publisher.Mono<OAuth2AccessTokenResponse>,org.springframework.http.ReactiveHttpInputMessage> bodyExtractor)
Sets theBodyExtractor
that will be used to decode theOAuth2AccessTokenResponse
void
setHeadersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.http.HttpHeaders> headersConverter)
Sets theConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aHttpHeaders
used in the OAuth 2.0 Access Token Request headers.void
setParametersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>> parametersConverter)
Sets theConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aMultiValueMap
used in the OAuth 2.0 Access Token Request body.void
setWebClient(org.springframework.web.reactive.function.client.WebClient webClient)
Sets theWebClient
used when requesting the OAuth 2.0 Access Token Response.
-
-
-
Method Detail
-
getTokenResponse
public reactor.core.publisher.Mono<OAuth2AccessTokenResponse> getTokenResponse(T grantRequest)
Description copied from interface:ReactiveOAuth2AccessTokenResponseClient
Exchanges the authorization grant credential, provided in the authorization grant request, for an access token credential at the Authorization Server's Token Endpoint.- Specified by:
getTokenResponse
in interfaceReactiveOAuth2AccessTokenResponseClient<T extends AbstractOAuth2AuthorizationGrantRequest>
- Parameters:
grantRequest
- the authorization grant request that contains the authorization grant credential- Returns:
- an
OAuth2AccessTokenResponse
that contains theaccess token
credential
-
setWebClient
public void setWebClient(org.springframework.web.reactive.function.client.WebClient webClient)
Sets theWebClient
used when requesting the OAuth 2.0 Access Token Response.- Parameters:
webClient
- theWebClient
used when requesting the Access Token Response
-
setHeadersConverter
public final void setHeadersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.http.HttpHeaders> headersConverter)
Sets theConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aHttpHeaders
used in the OAuth 2.0 Access Token Request headers.- Parameters:
headersConverter
- theConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
toHttpHeaders
- Since:
- 5.6
-
addHeadersConverter
public final void addHeadersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.http.HttpHeaders> headersConverter)
Add (compose) the providedheadersConverter
to the currentConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aHttpHeaders
used in the OAuth 2.0 Access Token Request headers.- Parameters:
headersConverter
- theConverter
to add (compose) to the currentConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
to aHttpHeaders
- Since:
- 5.6
-
setParametersConverter
public final void setParametersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>> parametersConverter)
Sets theConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aMultiValueMap
used in the OAuth 2.0 Access Token Request body.- Parameters:
parametersConverter
- theConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
toMultiValueMap
- Since:
- 5.6
-
addParametersConverter
public final void addParametersConverter(org.springframework.core.convert.converter.Converter<T,org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>> parametersConverter)
Add (compose) the providedparametersConverter
to the currentConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
instance to aMultiValueMap
used in the OAuth 2.0 Access Token Request body.- Parameters:
parametersConverter
- theConverter
to add (compose) to the currentConverter
used for converting theAbstractOAuth2AuthorizationGrantRequest
to aMultiValueMap
- Since:
- 5.6
-
setBodyExtractor
public final void setBodyExtractor(org.springframework.web.reactive.function.BodyExtractor<reactor.core.publisher.Mono<OAuth2AccessTokenResponse>,org.springframework.http.ReactiveHttpInputMessage> bodyExtractor)
Sets theBodyExtractor
that will be used to decode theOAuth2AccessTokenResponse
- Parameters:
bodyExtractor
- theBodyExtractor
that will be used to decode theOAuth2AccessTokenResponse
- Since:
- 5.6
-
-