public class IDTokenClaimsSet extends ClaimsSet
Example ID token claims set:
{
"iss" : "https://server.example.com",
"sub" : "24400320",
"aud" : "s6BhdRkqt3",
"nonce" : "n-0S6_WzA2Mj",
"exp" : 1311281970,
"iat" : 1311280970,
"auth_time" : 1311280969,
"acr" : "urn:mace:incommon:iap:silver",
"at_hash" : "MTIzNDU2Nzg5MDEyMzQ1Ng"
}
Related specifications:
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACR_CLAIM_NAME
The ACR claim name.
|
static java.lang.String |
AMR_CLAIM_NAME
The AMRs claim name.
|
static java.lang.String |
AT_HASH_CLAIM_NAME
The access token hash claim name.
|
static java.lang.String |
AUD_CLAIM_NAME
The audience claim name.
|
static java.lang.String |
AUTH_TIME_CLAIM_NAME
The subject authentication time claim name.
|
static java.lang.String |
AZP_CLAIM_NAME
The authorised party claim name.
|
static java.lang.String |
C_HASH_CLAIM_NAME
The authorisation code hash claim name.
|
static java.lang.String |
EXP_CLAIM_NAME
The expiration time claim name.
|
static java.lang.String |
IAT_CLAIM_NAME
The issue time claim name.
|
static java.lang.String |
ISS_CLAIM_NAME
The issuer claim name.
|
static java.lang.String |
NONCE_CLAIM_NAME
The nonce claim name.
|
static java.lang.String |
SUB_CLAIM_NAME
The subject claim name.
|
static java.lang.String |
SUB_JWK_CLAIM_NAME
The subject JWK claim name.
|
| Constructor and Description |
|---|
IDTokenClaimsSet(Issuer iss,
Subject sub,
java.util.List<Audience> aud,
java.util.Date exp,
java.util.Date iat)
Creates a new minimal ID token claims set.
|
IDTokenClaimsSet(com.nimbusds.jwt.ReadOnlyJWTClaimsSet jwtClaimsSet)
Creates a new ID token claims set from the specified JSON Web Token
(JWT) claims set.
|
| Modifier and Type | Method and Description |
|---|---|
AccessTokenHash |
getAccessTokenHash()
Gets the access token hash.
|
ACR |
getACR()
Gets the Authentication Context Class Reference (ACR).
|
java.util.List<AMR> |
getAMR()
Gets the Authentication Methods References (AMRs).
|
java.util.List<Audience> |
getAudience()
Gets the ID token audience.
|
java.util.Date |
getAuthenticationTime()
Gets the subject authentication time.
|
AuthorizedParty |
getAuthorizedParty()
Gets the authorised party for the ID token.
|
CodeHash |
getCodeHash()
Gets the authorisation code hash.
|
java.util.Date |
getExpirationTime()
Gets the ID token expiration time.
|
Issuer |
getIssuer()
Gets the ID token issuer.
|
java.util.Date |
getIssueTime()
Gets the ID token issue time.
|
Nonce |
getNonce()
Gets the ID token nonce.
|
static java.util.Set<java.lang.String> |
getStandardClaimNames()
Gets the names of the standard top-level ID token claims.
|
Subject |
getSubject()
Gets the ID token subject.
|
com.nimbusds.jose.jwk.JWK |
getSubjectJWK()
Gets the subject's JSON Web Key (JWK) for a self-issued OpenID
Connect provider.
|
boolean |
hasRequiredClaims(ResponseType rt)
Checks if this ID token claims set contains all required claims for
the specified OpenID Connect response type.
|
static IDTokenClaimsSet |
parse(java.lang.String json)
Parses an ID token claims set from the specified JSON object string.
|
void |
setAccessTokenHash(AccessTokenHash atHash)
Sets the access token hash.
|
void |
setACR(ACR acr)
Sets the Authentication Context Class Reference (ACR).
|
void |
setAMR(java.util.List<AMR> amr)
Sets the Authentication Methods References (AMRs).
|
void |
setAuthenticationTime(java.util.Date authTime)
Sets the subject authentication time.
|
void |
setAuthorizedParty(AuthorizedParty azp)
Sets the authorised party for the ID token.
|
void |
setCodeHash(CodeHash cHash)
Sets the authorisation code hash.
|
void |
setNonce(Nonce nonce)
Sets the ID token nonce.
|
void |
setSubjectJWK(com.nimbusds.jose.jwk.JWK subJWK)
Sets the subject's JSON Web Key (JWK) for a self-issued OpenID
Connect provider.
|
getBooleanClaim, getClaim, getClaim, getDateClaim, getEmailClaim, getLangTaggedClaim, getNumberClaim, getStringClaim, getStringClaim, getStringListClaim, getURIClaim, getURLClaim, putAll, setClaim, setClaim, setDateClaim, setEmailClaim, setURIClaim, setURLClaim, toJSONObject, toJWTClaimsSetpublic static final java.lang.String ISS_CLAIM_NAME
public static final java.lang.String SUB_CLAIM_NAME
public static final java.lang.String AUD_CLAIM_NAME
public static final java.lang.String EXP_CLAIM_NAME
public static final java.lang.String IAT_CLAIM_NAME
public static final java.lang.String AUTH_TIME_CLAIM_NAME
public static final java.lang.String NONCE_CLAIM_NAME
public static final java.lang.String AT_HASH_CLAIM_NAME
public static final java.lang.String C_HASH_CLAIM_NAME
public static final java.lang.String ACR_CLAIM_NAME
public static final java.lang.String AMR_CLAIM_NAME
public static final java.lang.String AZP_CLAIM_NAME
public static final java.lang.String SUB_JWK_CLAIM_NAME
public IDTokenClaimsSet(Issuer iss, Subject sub, java.util.List<Audience> aud, java.util.Date exp, java.util.Date iat)
iss - The issuer. Must not be null.sub - The subject. Must not be null.aud - The audience. Must not be null.exp - The expiration time. Must not be null.iat - The issue time. Must not be null.public IDTokenClaimsSet(com.nimbusds.jwt.ReadOnlyJWTClaimsSet jwtClaimsSet) throws ParseException
jwtClaimsSet - The JWT claims set. Must not be null.ParseException - If the JSON object doesn't contain the
minimally required issuer iss,
subject sub, audience list
aud, expiration date exp and
issue date iat claims.public static java.util.Set<java.lang.String> getStandardClaimNames()
public boolean hasRequiredClaims(ResponseType rt)
rt - The OpenID Connect response type. Must not be
null.true if the required claims are contained, else
false.public Issuer getIssuer()
iss claim.public Subject getSubject()
sub claim.public java.util.List<Audience> getAudience()
aud claim.public java.util.Date getExpirationTime()
exp
claim.public java.util.Date getIssueTime()
iss claim.public java.util.Date getAuthenticationTime()
auth_time claim.null if not specified or
parsing failed.public void setAuthenticationTime(java.util.Date authTime)
auth_time claim.authTime - The authentication time, null if not
specified.public Nonce getNonce()
nonce claim.null if not specified or parsing failed.public void setNonce(Nonce nonce)
nonce claim.nonce - The nonce, null if not specified.public AccessTokenHash getAccessTokenHash()
at_hash
claim.null if not specified or
parsing failed.public void setAccessTokenHash(AccessTokenHash atHash)
at_hash
claim.atHash - The access token hash, null if not specified.public CodeHash getCodeHash()
c_hash
claim.null if not specified
or parsing failed.public void setCodeHash(CodeHash cHash)
c_hash
claim.cHash - The authorisation code hash, null if not
specified.public ACR getACR()
acr claim.null if not specified or parsing failed.public void setACR(ACR acr)
acr claim.acr - The Authentication Context Class Reference (ACR),
null if not specified.public java.util.List<AMR> getAMR()
amr claim.null if not specified or parsing failed.public void setAMR(java.util.List<AMR> amr)
amr claim.amr - The Authentication Methods Reference (AMR) list,
null if not specified.public AuthorizedParty getAuthorizedParty()
azp claim.null if not specified or
parsing failed.public void setAuthorizedParty(AuthorizedParty azp)
azp claim.azp - The authorised party, null if not specified.public com.nimbusds.jose.jwk.JWK getSubjectJWK()
sub_jwk claim.null if not specified or parsing
failed.public void setSubjectJWK(com.nimbusds.jose.jwk.JWK subJWK)
sub_jwk claim.subJWK - The subject's JWK (must be public), null if
not specified.public static IDTokenClaimsSet parse(java.lang.String json) throws ParseException
json - The JSON object string to parse. Must not be
null.ParseException - If parsing failed.Copyright © 2014 Connect2id Ltd.. All Rights Reserved.