@Immutable public class TokenSpec extends Object
Constructor and Description |
---|
TokenSpec(long lifetime)
Creates a new token specification.
|
TokenSpec(long lifetime,
List<com.nimbusds.oauth2.sdk.id.Audience> audList)
Creates a new token specification.
|
Modifier and Type | Method and Description |
---|---|
List<com.nimbusds.oauth2.sdk.id.Audience> |
getAudience()
Returns the explicit list of audiences for the token.
|
long |
getLifetime()
Returns the token lifetime.
|
static TokenSpec |
parse(net.minidev.json.JSONObject jsonObject)
Parses a token specification from the specified JSON object.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this token specification.
|
String |
toString() |
public TokenSpec(long lifetime)
lifetime
- The token lifetime, in seconds. Zero implies
permanent or not specified (to let the Connect2id
server apply the default configured lifetime),
depending on the token type. Must not be a negative
integer.public TokenSpec(long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList)
lifetime
- The token lifetime, in seconds. Zero implies
permanent or not specified (to let the Connect2id
server apply the default configured lifetime),
depending on the token type. Must not be a negative
integer.audList
- Explicit list of audiences for the token,
null
if not specified.public long getLifetime()
public List<com.nimbusds.oauth2.sdk.id.Audience> getAudience()
null
if not specified.public net.minidev.json.JSONObject toJSONObject()
public static TokenSpec parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException
jsonObject
- The JSON object. Must not be null
.com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.Copyright © 2015 Connect2id Ltd.. All Rights Reserved.