@Immutable public class OptionalTokenSpec extends TokenSpec
| Constructor and Description |
|---|
OptionalTokenSpec(boolean issue,
long lifetime,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject)
Creates a new optional token specification.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
issue()
Returns the token issue policy.
|
static OptionalTokenSpec |
parse(net.minidev.json.JSONObject jsonObject)
Parses an optional token specification from the specified JSON
object.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this token specification.
|
getAudience, getImpersonatedSubject, getLifetime, toStringpublic OptionalTokenSpec(boolean issue, long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList, com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject)
issue - If true a token must be issued,
false to prohibit issue.lifetime - The token lifetime, in seconds. For
access tokens zero and negative implies
not specified (to let the Connect2id
server apply the default configured
access token lifetime). For refresh
tokens zero implies permanent (no
expiration) and negative not specified
(to let the Connect2id server apply the
default configured refresh token
lifetime).audList - Explicit list of audiences for the token,
null if not specified.impersonatedSubject - The subject in impersonation and
delegation cases, null if not
applicable.public boolean issue()
true if a token must be issued, false to
prohibit issue.public net.minidev.json.JSONObject toJSONObject()
TokenSpectoJSONObject in class TokenSpecpublic static OptionalTokenSpec 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 © 2021 Connect2id Ltd.. All rights reserved.