public class AccessTokenSpec extends TokenSpec
Constructor and Description |
---|
AccessTokenSpec()
Creates a new default access token specification.
|
AccessTokenSpec(long lifetime,
com.nimbusds.oauth2.sdk.token.TokenEncoding encoding,
boolean encrypt)
Creates a new access token specification.
|
Modifier and Type | Method and Description |
---|---|
boolean |
encrypt()
Returns the access token encryption flag.
|
com.nimbusds.oauth2.sdk.token.TokenEncoding |
getEncoding()
Returns the access token encoding.
|
static AccessTokenSpec |
parse(net.minidev.json.JSONObject o)
Parses an access token specification from the specified JSON object.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this token specification.
|
getLifetime
public AccessTokenSpec()
public AccessTokenSpec(long lifetime, com.nimbusds.oauth2.sdk.token.TokenEncoding encoding, boolean encrypt)
lifetime
- The access token lifetime, in seconds, zero if not
specified (to apply the default configured lifetime
for access tokens).encoding
- The access token encoding. Must not be null
.encrypt
- If true
flags the access token for
encryption. Applies to self-contained (JWT) access
tokens only.public com.nimbusds.oauth2.sdk.token.TokenEncoding getEncoding()
public boolean encrypt()
true
the access token is flagged for encryption.
Applies to self-contained access tokens only.public net.minidev.json.JSONObject toJSONObject()
TokenSpec
toJSONObject
in class TokenSpec
public static AccessTokenSpec parse(net.minidev.json.JSONObject o) throws com.nimbusds.oauth2.sdk.ParseException
o
- The JSON object. Must not be null
.com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.Copyright © 2015 Connect2id Ltd.. All Rights Reserved.