public abstract class Token extends Identifier
Related specifications:
DEFAULT_BYTE_LENGTH
Modifier | Constructor and Description |
---|---|
protected |
Token()
Creates a new token with a randomly generated 256-bit (32-byte)
value, Base64URL-encoded.
|
protected |
Token(int byteLength)
Creates a new token with a randomly generated value of the specified
byte length, Base64URL-encoded.
|
protected |
Token(java.lang.String value)
Creates a new token with the specified value.
|
Modifier and Type | Method and Description |
---|---|
abstract java.util.Set<java.lang.String> |
getParameterNames()
Returns the token parameter names included in the JSON object, as
required for the composition of an access token response.
|
abstract net.minidev.json.JSONObject |
toJSONObject()
Returns the token parameters as a JSON object, as required for the
composition of an access token response.
|
compareTo, equals, getValue, hashCode, toJSONString, toString
protected Token(java.lang.String value)
value
- The token value. Must not be null
or empty
string.protected Token(int byteLength)
byteLength
- The byte length of the value to generate. Must be
greater than one.protected Token()
public abstract java.util.Set<java.lang.String> getParameterNames()
public abstract net.minidev.json.JSONObject toJSONObject()
Note that JSONObject implements Map<String,Object>.
Example:
{ "access_token" : "2YotnFZFEjr1zCsicMWpAA", "token_type" : "example", "expires_in" : 3600, "example_parameter" : "example_value" }
Copyright © 2016 Connect2id Ltd.. All Rights Reserved.