Class TokenResult
java.lang.Object
org.glassfish.jersey.client.oauth2.TokenResult
Class that contains a result of the Authorization Flow including a access token.
All result properties can be get by the method getAllProperties()
. Some of the properties
are standardized by the OAuth 2 specification and therefore the class contains getters that extract
these properties from the property map.
- Since:
- 2.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTokenResult
(Map<String, Object> properties) Create a new instance initiated from the property map. -
Method Summary
Modifier and TypeMethodDescriptionGet access token.Get the map of all properties returned in the Access Token Response.Get expiration time of theaccess token
in seconds.private String
getProperty
(String name) Get the refresh token.Get the type of the returned access token.
-
Field Details
-
properties
-
-
Constructor Details
-
TokenResult
Create a new instance initiated from the property map.- Parameters:
properties
- Access properties.
-
-
Method Details
-
getAccessToken
Get access token.- Returns:
- Access token.
-
getExpiresIn
Get expiration time of theaccess token
in seconds.- Returns:
- Expiration time in seconds or
null
if the value is not provided.
-
getRefreshToken
Get the refresh token. Note that the refresh token must not be issued during the authorization flow. Some Service Providers issue refresh token only on first user authorization and some providers does not support refresh token at all and authorization flow must be always performed when token expires.- Returns:
- Refresh token or
null
if the value is not provided.
-
getTokenType
Get the type of the returned access token. Type is in most casesbearer
(no cryptography is used) but provider might support also other kinds of token likemac
.- Returns:
- Token type.
-
getAllProperties
Get the map of all properties returned in the Access Token Response.- Returns:
- Map with all token properties.
-
getProperty
-