Class AccessTokenHash
java.lang.Object
com.nimbusds.oauth2.sdk.id.Identifier
com.nimbusds.openid.connect.sdk.claims.HashClaim
com.nimbusds.openid.connect.sdk.claims.AccessTokenHash
- All Implemented Interfaces:
Serializable,Comparable<Identifier>,net.minidev.json.JSONAware
Access token hash (
at_hash).
Related specifications:
- OpenID Connect Core 1.0, section 3.1.3.6.
- See Also:
-
Field Summary
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom -
Constructor Summary
ConstructorsConstructorDescriptionAccessTokenHash(String value) Creates a new access token hash with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessTokenHashcompute(AccessToken accessToken, com.nimbusds.jose.JWSAlgorithm alg) Deprecated.static AccessTokenHashcompute(AccessToken accessToken, com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv) Computes the hash for the specified access token and reference JSON Web Signature (JWS) algorithm.booleanstatic booleanisRequiredInIDTokenClaims(ResponseType responseType) Checks if an access token hash claim must be included in ID tokens for the specified response type.Methods inherited from class com.nimbusds.openid.connect.sdk.claims.HashClaim
computeValue, computeValue, getMessageDigestInstance, getMessageDigestInstanceMethods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
Constructor Details
-
AccessTokenHash
Creates a new access token hash with the specified value.- Parameters:
value- The access token hash value. Must not benull.
-
-
Method Details
-
isRequiredInIDTokenClaims
Checks if an access token hash claim must be included in ID tokens for the specified response type.- Parameters:
responseType- The OpenID Connect response type. Must not benull.- Returns:
trueif the access token hash is required, elsefalse.
-
compute
@Deprecated public static AccessTokenHash compute(AccessToken accessToken, com.nimbusds.jose.JWSAlgorithm alg) Deprecated.Usecompute(AccessToken, JWSAlgorithm, Curve)instead.Computes the hash for the specified access token and reference JSON Web Signature (JWS) algorithm.- Parameters:
accessToken- The access token. Must not benull.alg- The reference JWS algorithm. Must not benull.- Returns:
- The access token hash, or
nullif the JWS algorithm is not supported.
-
compute
public static AccessTokenHash compute(AccessToken accessToken, com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv) Computes the hash for the specified access token and reference JSON Web Signature (JWS) algorithm.- Parameters:
accessToken- The access token. Must not benull.alg- The reference JWS algorithm. Must not benull.crv- The JWK curve used with the JWS algorithm,nullif not applicable.- Returns:
- The access token hash, or
nullif the JWS algorithm is not supported.
-
equals
- Overrides:
equalsin classIdentifier
-
compute(AccessToken, JWSAlgorithm, Curve)instead.