Package com.nimbusds.oauth2.sdk.token
Class NAAccessToken
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Identifier
-
- com.nimbusds.oauth2.sdk.token.Token
-
- com.nimbusds.oauth2.sdk.token.AccessToken
-
- com.nimbusds.oauth2.sdk.token.NAAccessToken
-
- All Implemented Interfaces:
Serializable,Comparable<Identifier>,net.minidev.json.JSONAware
@Immutable public class NAAccessToken extends AccessToken
Access token of type not applicable (N/A), intended for use in OAuth 2.0 token exchange scenarios.Related specifications:
- OAuth 2.0 Token Exchange (RFC 8693), section 2.2.1.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
-
Constructor Summary
Constructors Constructor Description NAAccessToken(String value, long lifetime, Scope scope, TokenTypeURI issuedTokenType)Creates a new N/A access token with the specified value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NAAccessTokenparse(net.minidev.json.JSONObject jsonObject)Parses a N/A access token from a JSON object access token response.StringtoAuthorizationHeader()Returns theAuthorizationHTTP request header value for this access token.-
Methods inherited from class com.nimbusds.oauth2.sdk.token.AccessToken
getIssuedTokenType, getLifetime, getParameterNames, getScope, getType, parse, parse, parse, toJSONObject, toJSONString
-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, equals, getValue, hashCode, toString, toStringList
-
-
-
-
Constructor Detail
-
NAAccessToken
public NAAccessToken(String value, long lifetime, Scope scope, TokenTypeURI issuedTokenType)
Creates a new N/A access token with the specified value.- Parameters:
value- The access token value. Must not benullor empty string.lifetime- The lifetime in seconds, 0 if not specified.scope- The scope,nullif not specified.issuedTokenType- The token type URI,nullif not specified.
-
-
Method Detail
-
toAuthorizationHeader
public String toAuthorizationHeader()
Description copied from class:AccessTokenReturns theAuthorizationHTTP request header value for this access token.- Specified by:
toAuthorizationHeaderin classAccessToken- Returns:
- The
Authorizationheader value.
-
parse
public static NAAccessToken parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses a N/A access token from a JSON object access token response.- Parameters:
jsonObject- The JSON object to parse. Must not benull.- Returns:
- The N/A access token.
- Throws:
ParseException- If the JSON object couldn't be parsed to a N/A access token.
-
-