@Immutable public class AccessTokenSpec extends TokenSpec
Modifier and Type | Field and Description |
---|---|
static AccessTokenSpec |
DEFAULT
Default access token specification.
|
Constructor and Description |
---|
AccessTokenSpec()
Creates a new default access token specification.
|
AccessTokenSpec(long lifetime,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
com.nimbusds.oauth2.sdk.token.TokenEncoding encoding,
boolean encrypt)
Creates a new access token specification.
|
AccessTokenSpec(long lifetime,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
com.nimbusds.oauth2.sdk.token.TokenEncoding encoding,
com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject,
boolean encrypt)
Creates a new 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 jsonObject)
Parses an access token specification from the specified JSON object.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this token specification.
|
getAudience, getImpersonatedSubject, getLifetime, toString
public static final AccessTokenSpec DEFAULT
public AccessTokenSpec()
public AccessTokenSpec(long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList, com.nimbusds.oauth2.sdk.token.TokenEncoding encoding, com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject, boolean encrypt)
lifetime
- The access token lifetime, in seconds,
zero if not specified (to let the
Connect2id server apply the default
configured lifetime for access tokens).audList
- Explicit list of audiences for the access
token, null
if not specified.encoding
- The access token encoding. Must not be
null
.impersonatedSubject
- The subject in impersonation and
delegation cases, null
if not
applicable.encrypt
- If true
flags the access token
for encryption. Applies to self-contained
(JWT) access tokens only.public AccessTokenSpec(long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList, com.nimbusds.oauth2.sdk.token.TokenEncoding encoding, boolean encrypt)
lifetime
- The access token lifetime, in seconds, zero if not
specified (to let the Connect2id server apply the
default configured lifetime for access tokens).audList
- Explicit list of audiences for the access token,
null
if not specified.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 AccessTokenSpec(long lifetime, com.nimbusds.oauth2.sdk.token.TokenEncoding encoding, boolean encrypt)
lifetime
- The access token lifetime, in seconds, zero if not
specified (to let the Connect2id server 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 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.