@Immutable public class AccessTokenSpec extends TokenSpec
Modifier and Type | Field and Description |
---|---|
static AccessTokenSpec |
DEFAULT
The 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)
Deprecated.
|
AccessTokenSpec(long lifetime,
List<com.nimbusds.oauth2.sdk.id.Audience> audList,
com.nimbusds.oauth2.sdk.token.TokenEncoding encoding,
Optional<Boolean> encryptSelfContained)
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)
Deprecated.
|
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,
com.nimbusds.openid.connect.sdk.SubjectType subjectType)
Deprecated.
|
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,
Optional<Boolean> encryptSelfContained,
com.nimbusds.openid.connect.sdk.SubjectType subjectType)
Creates a new access token specification.
|
AccessTokenSpec(long lifetime,
com.nimbusds.oauth2.sdk.token.TokenEncoding encoding,
boolean encrypt)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
encrypt()
Deprecated.
Use
getEncryptSelfContained() instead. |
com.nimbusds.oauth2.sdk.token.TokenEncoding |
getEncoding()
Returns the access token encoding.
|
Optional<Boolean> |
getEncryptSelfContained()
Returns the optional encryption preference for self-contained (JWT)
access tokens.
|
com.nimbusds.openid.connect.sdk.SubjectType |
getSubjectType()
Returns the access token subject type.
|
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()
@Deprecated 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.@Deprecated 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.@Deprecated 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.@Deprecated 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, com.nimbusds.openid.connect.sdk.SubjectType subjectType)
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.subjectType
- The access token subject type.public AccessTokenSpec(long lifetime, List<com.nimbusds.oauth2.sdk.id.Audience> audList, com.nimbusds.oauth2.sdk.token.TokenEncoding encoding, Optional<Boolean> encryptSelfContained)
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
.encryptSelfContained
- The optional encryption preference for
self-contained (JWT) access tokens.
Must not be null
.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, Optional<Boolean> encryptSelfContained, com.nimbusds.openid.connect.sdk.SubjectType subjectType)
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.encryptSelfContained
- The optional encryption preference for
self-contained (JWT) access tokens.
Must not be null
.subjectType
- The access token subject type.public com.nimbusds.oauth2.sdk.token.TokenEncoding getEncoding()
@Deprecated public boolean encrypt()
getEncryptSelfContained()
instead.true
the access token is flagged for encryption.
Applies to self-contained access tokens only.public Optional<Boolean> getEncryptSelfContained()
public com.nimbusds.openid.connect.sdk.SubjectType getSubjectType()
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.