Class IDTokenSpec
java.lang.Object
com.nimbusds.openid.connect.provider.spi.grants.TokenSpec
com.nimbusds.openid.connect.provider.spi.grants.OptionalTokenSpec
com.nimbusds.openid.connect.provider.spi.grants.IDTokenSpec
Identity (ID) token specification.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IDTokenSpec
None (no issue) ID token specification. -
Constructor Summary
ConstructorDescriptionCreates a new default ID token specification (no issue).IDTokenSpec
(boolean issue, long lifetime, @Nullable com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject) Creates a new ID token specification.IDTokenSpec
(boolean issue, long lifetime, @Nullable Date authTime, @Nullable com.nimbusds.openid.connect.sdk.claims.ACR acr, @Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR> amrList, boolean allowRefresh, @Nullable com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject) Creates a new ID token specification.IDTokenSpec
(boolean issue, long lifetime, @Nullable Date authTime, @Nullable com.nimbusds.openid.connect.sdk.claims.ACR acr, @Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR> amrList, @Nullable com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject) Creates a new ID token specification. -
Method Summary
Modifier and TypeMethodDescription@Nullable com.nimbusds.openid.connect.sdk.claims.ACR
getACR()
Returns the Authentication Context Class Reference (ACR).@Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR>
Returns The Authentication Methods Reference (AMR) list.@Nullable Date
Returns the time of the subject authentication.boolean
Returns the ID token refresh setting.static IDTokenSpec
parse
(net.minidev.json.JSONObject jsonObject) Parses an ID token specification from the specified JSON object.net.minidev.json.JSONObject
Returns a JSON object representation of this token specification.Methods inherited from class com.nimbusds.openid.connect.provider.spi.grants.OptionalTokenSpec
issue
Methods inherited from class com.nimbusds.openid.connect.provider.spi.grants.TokenSpec
getAudience, getImpersonatedSubject, getLifetime, toString
-
Field Details
-
NONE
None (no issue) ID token specification.
-
-
Constructor Details
-
IDTokenSpec
public IDTokenSpec()Creates a new default ID token specification (no issue). -
IDTokenSpec
public IDTokenSpec(boolean issue, long lifetime, @Nullable com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject) Creates a new ID token specification.- Parameters:
issue
- Controls the ID token issue. Iftrue
an ID token must be issued,false
to prohibit issue.lifetime
- The ID token lifetime, in seconds, zero if not specified (to let the Connect2id server apply the default configured lifetime for ID tokens).impersonatedSubject
- The subject in impersonation and delegation cases,null
if not applicable.
-
IDTokenSpec
public IDTokenSpec(boolean issue, long lifetime, @Nullable Date authTime, @Nullable com.nimbusds.openid.connect.sdk.claims.ACR acr, @Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR> amrList, @Nullable com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject) Creates a new ID token specification.- Parameters:
issue
- Controls the ID token issue. Iftrue
an ID token must be issued,false
to prohibit issue.lifetime
- The ID token lifetime, in seconds, zero if not specified (to let the Connect2id server apply the default configured lifetime for ID tokens).authTime
- The time of the subject authentication. Ifnull
it will be set to now. Applies only if an ID token is issued.acr
- The Authentication Context Class Reference (ACR),null
if not specified. Applies only if an ID token is issued.amrList
- The Authentication Methods Reference (AMR) list,null
if not specified. Applies only if an ID token is issued.impersonatedSubject
- The subject in impersonation and delegation cases,null
if not applicable.
-
IDTokenSpec
public IDTokenSpec(boolean issue, long lifetime, @Nullable Date authTime, @Nullable com.nimbusds.openid.connect.sdk.claims.ACR acr, @Nullable List<com.nimbusds.openid.connect.sdk.claims.AMR> amrList, boolean allowRefresh, @Nullable com.nimbusds.oauth2.sdk.id.Subject impersonatedSubject) Creates a new ID token specification.- Parameters:
issue
- Controls the ID token issue. Iftrue
an ID token must be issued,false
to prohibit issue.lifetime
- The ID token lifetime, in seconds, zero if not specified (to let the Connect2id server apply the default configured lifetime for ID tokens).authTime
- The time of the subject authentication. Ifnull
it will be set to now. Applies only if an ID token is issued.acr
- The Authentication Context Class Reference (ACR),null
if not specified. Applies only if an ID token is issued.amrList
- The Authentication Methods Reference (AMR) list,null
if not specified. Applies only if an ID token is issued.allowRefresh
-true
to allow ID token refresh until the subject session is closed or expires.impersonatedSubject
- The subject in impersonation and delegation cases,null
if not applicable.
-
-
Method Details
-
getAuthTime
Returns the time of the subject authentication.- Returns:
- The time of the subject authentication. If
null
it will be set to now. Applies only if an ID token is issued.
-
getACR
Returns the Authentication Context Class Reference (ACR).- Returns:
- The Authentication Context Class Reference (ACR),
null
if not specified. Applies only if an ID token is issued.
-
getAMRList
Returns The Authentication Methods Reference (AMR) list.- Returns:
- The Authentication Methods Reference (AMR) list,
null
if not specified. Applies only if an ID token is issued.
-
isAllowRefresh
Returns the ID token refresh setting.- Returns:
true
to allow ID token refresh until the subject session is closed or expires.
-
toJSONObject
Description copied from class:TokenSpec
Returns a JSON object representation of this token specification.- Overrides:
toJSONObject
in classOptionalTokenSpec
- Returns:
- The JSON object.
-
parse
public static IDTokenSpec parse(net.minidev.json.JSONObject jsonObject) throws com.nimbusds.oauth2.sdk.ParseException Parses an ID token specification from the specified JSON object.- Parameters:
jsonObject
- The JSON object. Must not benull
.- Returns:
- The ID token specification.
- Throws:
com.nimbusds.oauth2.sdk.ParseException
- If parsing failed.
-