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(String value)
Creates a new token with the specified value.
|
| Modifier and Type | Method and Description |
|---|---|
abstract net.minidev.json.JSONObject |
toJSONObject()
Returns the token parameters as a JSON object, as required for the
composition of an access token response.
|
equals, getValue, hashCode, toJSONString, toStringprotected Token(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 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 © 2013 NimbusDS. All Rights Reserved.