Class DefaultJwtBearerTokenResponseClient
- java.lang.Object
-
- org.springframework.security.oauth2.client.endpoint.DefaultJwtBearerTokenResponseClient
-
- All Implemented Interfaces:
OAuth2AccessTokenResponseClient<JwtBearerGrantRequest>
public final class DefaultJwtBearerTokenResponseClient extends java.lang.Object implements OAuth2AccessTokenResponseClient<JwtBearerGrantRequest>
The default implementation of anOAuth2AccessTokenResponseClientfor thejwt-bearergrant. This implementation uses aRestOperationswhen requesting an access token credential at the Authorization Server's Token Endpoint.
-
-
Constructor Summary
Constructors Constructor Description DefaultJwtBearerTokenResponseClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2AccessTokenResponsegetTokenResponse(JwtBearerGrantRequest jwtBearerGrantRequest)Exchanges the authorization grant credential, provided in the authorization grant request, for an access token credential at the Authorization Server's Token Endpoint.voidsetRequestEntityConverter(org.springframework.core.convert.converter.Converter<JwtBearerGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)Sets theConverterused for converting theJwtBearerGrantRequestto aRequestEntityrepresentation of the OAuth 2.0 Access Token Request.voidsetRestOperations(org.springframework.web.client.RestOperations restOperations)Sets theRestOperationsused when requesting the OAuth 2.0 Access Token Response.
-
-
-
Method Detail
-
getTokenResponse
public OAuth2AccessTokenResponse getTokenResponse(JwtBearerGrantRequest jwtBearerGrantRequest)
Description copied from interface:OAuth2AccessTokenResponseClientExchanges the authorization grant credential, provided in the authorization grant request, for an access token credential at the Authorization Server's Token Endpoint.- Specified by:
getTokenResponsein interfaceOAuth2AccessTokenResponseClient<JwtBearerGrantRequest>- Parameters:
jwtBearerGrantRequest- the authorization grant request that contains the authorization grant credential- Returns:
- an
OAuth2AccessTokenResponsethat contains theaccess tokencredential
-
setRequestEntityConverter
public void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<JwtBearerGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Sets theConverterused for converting theJwtBearerGrantRequestto aRequestEntityrepresentation of the OAuth 2.0 Access Token Request.- Parameters:
requestEntityConverter- theConverterused for converting to aRequestEntityrepresentation of the Access Token Request
-
setRestOperations
public void setRestOperations(org.springframework.web.client.RestOperations restOperations)
Sets theRestOperationsused when requesting the OAuth 2.0 Access Token Response.NOTE: At a minimum, the supplied
restOperationsmust be configured with the following:HttpMessageConverter's -FormHttpMessageConverterandOAuth2AccessTokenResponseHttpMessageConverterResponseErrorHandler-OAuth2ErrorResponseErrorHandler
- Parameters:
restOperations- theRestOperationsused when requesting the Access Token Response
-
-