public class OptionalTokenSpec extends TokenSpec
Constructor and Description |
---|
OptionalTokenSpec(boolean issue,
long lifetime)
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 o)
Parses an optional token specification from the specified JSON
object.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this token specification.
|
getLifetime
public OptionalTokenSpec(boolean issue, long lifetime)
issue
- If true
a token must be issued,
false
to prohibit issue.lifetime
- The token lifetime, in seconds. Zero implies
permanent or not specified (to apply the default
configured token lifetime), depending on the token
type. Must not be negative integer.public boolean issue()
true
if a token must be issued, false
to
prohibit issue.public net.minidev.json.JSONObject toJSONObject()
TokenSpec
toJSONObject
in class TokenSpec
public static OptionalTokenSpec 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.