public class OAuth2AuthorizedClient
extends java.lang.Object
implements java.io.Serializable
A client is considered "authorized" when the End-User (Resource Owner) has granted authorization to the client to access it's protected resources.
This class associates the Client
to the
Access Token
granted/authorized by the
Resource Owner
.
ClientRegistration
,
OAuth2AccessToken
,
OAuth2RefreshToken
,
Serialized FormConstructor and Description |
---|
OAuth2AuthorizedClient(ClientRegistration clientRegistration,
java.lang.String principalName,
OAuth2AccessToken accessToken)
Constructs an
OAuth2AuthorizedClient using the provided parameters. |
OAuth2AuthorizedClient(ClientRegistration clientRegistration,
java.lang.String principalName,
OAuth2AccessToken accessToken,
OAuth2RefreshToken refreshToken)
Constructs an
OAuth2AuthorizedClient using the provided parameters. |
Modifier and Type | Method and Description |
---|---|
OAuth2AccessToken |
getAccessToken()
Returns the
access token credential granted. |
ClientRegistration |
getClientRegistration()
Returns the authorized client's
registration . |
java.lang.String |
getPrincipalName()
Returns the End-User's
Principal name. |
OAuth2RefreshToken |
getRefreshToken()
Returns the
refresh token credential granted. |
public OAuth2AuthorizedClient(ClientRegistration clientRegistration, java.lang.String principalName, OAuth2AccessToken accessToken)
OAuth2AuthorizedClient
using the provided parameters.clientRegistration
- the authorized client's registrationprincipalName
- the name of the End-User Principal
(Resource Owner)accessToken
- the access token credential grantedpublic OAuth2AuthorizedClient(ClientRegistration clientRegistration, java.lang.String principalName, OAuth2AccessToken accessToken, @Nullable OAuth2RefreshToken refreshToken)
OAuth2AuthorizedClient
using the provided parameters.clientRegistration
- the authorized client's registrationprincipalName
- the name of the End-User Principal
(Resource Owner)accessToken
- the access token credential grantedrefreshToken
- the refresh token credential grantedpublic ClientRegistration getClientRegistration()
registration
.ClientRegistration
public java.lang.String getPrincipalName()
Principal
name.Principal
namepublic OAuth2AccessToken getAccessToken()
access token
credential granted.OAuth2AccessToken
@Nullable public OAuth2RefreshToken getRefreshToken()
refresh token
credential granted.OAuth2RefreshToken