Package com.nimbusds.oauth2.sdk.jarm
Class JARMUtils
java.lang.Object
com.nimbusds.oauth2.sdk.jarm.JARMUtils
JWT Secured Authorization Response Mode for OAuth 2.0 (JARM) utilities.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanimpliesAuthorizationErrorResponse(com.nimbusds.jwt.JWT jwt) Returnstrueif the specified JWT-secured authorisation response implies an error response.static booleanimpliesAuthorizationErrorResponse(String jwtString) Returnstrueif the specified JWT-secured authorisation response implies an error response.static booleansupportsJARM(AuthorizationServerMetadata asMetadata) Returnstrueif JARM is supported for the specified OpenID provider / Authorisation server metadata.static com.nimbusds.jwt.JWTClaimsSettoJWTClaimsSet(Issuer iss, ClientID aud, Date exp, AuthorizationResponse response) Creates a JSON Web Token (JWT) claims set for the specified authorisation success response.toMultiValuedStringParameters(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) Returns a multi-valued map representation of the specified JWT claims set.
-
Field Details
-
RESPONSE_MODES
The JARM response modes.
-
-
Method Details
-
supportsJARM
Returnstrueif JARM is supported for the specified OpenID provider / Authorisation server metadata.- Parameters:
asMetadata- The OpenID provider / Authorisation server metadata. Must not benull.- Returns:
trueif JARM is supported, elsefalse.
-
toJWTClaimsSet
public static com.nimbusds.jwt.JWTClaimsSet toJWTClaimsSet(Issuer iss, ClientID aud, Date exp, AuthorizationResponse response) Creates a JSON Web Token (JWT) claims set for the specified authorisation success response.- Parameters:
iss- The OAuth 2.0 authorisation server issuer. Must not benull.aud- The client ID. Must not benull.exp- The JWT expiration time. Must not benull.response- The plain authorisation response to use its parameters. If it specifies aniss(issuer) parameter its value must match the JWTissclaim. Must not benull.- Returns:
- The JWT claims set.
-
toMultiValuedStringParameters
public static Map<String,List<String>> toMultiValuedStringParameters(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) Returns a multi-valued map representation of the specified JWT claims set.- Parameters:
jwtClaimsSet- The JWT claims set. Must not benull.- Returns:
- The multi-valued map.
-
impliesAuthorizationErrorResponse
Returnstrueif the specified JWT-secured authorisation response implies an error response. Note that the JWT is not validated in any way!- Parameters:
jwtString- The JWT-secured authorisation response string. Must not benull.- Returns:
trueif an error is implied by the presence of theerrorclaim, elsefalse(also for encrypted JWTs which payload cannot be inspected without decrypting first).- Throws:
ParseException- If the JWT is invalid or plain (unsecured).
-
impliesAuthorizationErrorResponse
public static boolean impliesAuthorizationErrorResponse(com.nimbusds.jwt.JWT jwt) throws ParseException Returnstrueif the specified JWT-secured authorisation response implies an error response. Note that the JWT is not validated in any way!- Parameters:
jwt- The JWT-secured authorisation response. Must not benull.- Returns:
trueif an error is implied by the presence of theerrorclaim, elsefalse(also for encrypted JWTs which payload cannot be inspected without decrypting first).- Throws:
ParseException- If the JWT is plain (unsecured).
-