Package com.nimbusds.oauth2.sdk.jarm
Class JARMUtils
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.jarm.JARMUtils
-
-
Field Summary
Fields Modifier and Type Field Description static Set<ResponseMode>
RESPONSE_MODES
The JARM response modes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
impliesAuthorizationErrorResponse(com.nimbusds.jwt.JWT jwt)
Returnstrue
if the specified JWT-secured authorisation response implies an error response.static boolean
impliesAuthorizationErrorResponse(String jwtString)
Returnstrue
if the specified JWT-secured authorisation response implies an error response.static boolean
supportsJARM(AuthorizationServerMetadata asMetadata)
Returnstrue
if JARM is supported for the specified OpenID provider / Authorisation server metadata.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.static Map<String,List<String>>
toMultiValuedStringParameters(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
Returns a multi-valued map representation of the specified JWT claims set.
-
-
-
Field Detail
-
RESPONSE_MODES
public static final Set<ResponseMode> RESPONSE_MODES
The JARM response modes.
-
-
Method Detail
-
supportsJARM
public static boolean supportsJARM(AuthorizationServerMetadata asMetadata)
Returnstrue
if JARM is supported for the specified OpenID provider / Authorisation server metadata.- Parameters:
asMetadata
- The OpenID provider / Authorisation server metadata. Must not benull
.- Returns:
true
if 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 JWTiss
claim. 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
public static boolean impliesAuthorizationErrorResponse(String jwtString) throws ParseException
Returnstrue
if 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:
true
if an error is implied by the presence of theerror
claim, 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
Returnstrue
if 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:
true
if an error is implied by the presence of theerror
claim, elsefalse
(also for encrypted JWTs which payload cannot be inspected without decrypting first).- Throws:
ParseException
- If the JWT is plain (unsecured).
-
-