Package com.nimbusds.oauth2.sdk.token
Class TypelessToken
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Identifier
-
- com.nimbusds.oauth2.sdk.token.Token
-
- com.nimbusds.oauth2.sdk.token.TypelessToken
-
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
@Immutable public class TypelessToken extends Token
Typeless (generic) token.- 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 TypelessToken(String value)
Creates a new typeless token with the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getParameterNames()
Returns the token parameter names included in the JSON object, as required for the composition of an access token response.net.minidev.json.JSONObject
toJSONObject()
Returns the token parameters as a JSON object, as required for the composition of an access token response.-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, equals, getValue, hashCode, toJSONString, toString, toStringList
-
-
-
-
Constructor Detail
-
TypelessToken
public TypelessToken(String value)
Creates a new typeless token with the specified value.- Parameters:
value
- The token value. Must not benull
or empty string.
-
-
Method Detail
-
getParameterNames
public Set<String> getParameterNames()
Description copied from class:Token
Returns the token parameter names included in the JSON object, as required for the composition of an access token response. See OAuth 2.0 (RFC 6749), section 5.1.- Specified by:
getParameterNames
in classToken
- Returns:
- The token parameter names.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Description copied from class:Token
Returns the token parameters as a JSON object, as required for the composition of an access token response. See OAuth 2.0 (RFC 6749), section 5.1.Note that JSONObject implements Map<String,Object>.
Example:
{ "access_token" : "2YotnFZFEjr1zCsicMWpAA", "token_type" : "example", "expires_in" : 3600, "example_parameter" : "example_value" }
- Specified by:
toJSONObject
in classToken
- Returns:
- The token parameters as a JSON object.
-
-