Decode JSON Web Token Assertion
The Decode JSON Web Token Assertion decodes a JSON Web Token by verifying the signature of a JWS, and/or decrypting a JWE message.
gateway83
The
Decode JSON Web Token Assertion
decodes a JSON Web Token by verifying the signature of a JWS, and/or decrypting a JWE message.For a nested JWT (both signed and encrypted), use one Decode JSON Web Token assertion to decrypt, then pass the resulting payload
${<prefix>.plaintext}
to a second Decode JSON Web Token assertion.For more details, see the JWT specification.
Output from the Create JSON Web Key Assertion cannot be used to decrypt a JSON Web Token.
Contents:
Assertion Logic
By design, the Decode JSON Web Token assertion does not stop or fail on detection of an invalid JWT signature. Rather, the verification results are recorded in the
$<prefix>.valid
context variable (true/false) and policy processing continues. If you intend for the policy to fail, place a Compare Expression Assertion immediately after the Decode JSON Web Token assertion to check ${prefix}.valid
. Then, add logic to terminate the policy if that variable returns "false".For a detailed description on implementing this workaround, see "Decode JSON Web Token Assertion Unaffected by Invalid JWT Signature" in Known Issues.
Context Variables
Stored with a variable prefixed as defined in field,
Destination Variable Prefix
.- ${<prefix>.valid}
- ${<prefix>.type}
- ${<prefix>.header.names}
- ${<prefix>.header.XXX}
Set if JSON Web Token is a JWS:
- ${<prefix>.payload}
- ${<prefix>.signature}
Set if JSON Web Token is a JWE:
- ${<prefix>.encrypted_key}
- ${<prefix>.initialization_vector}
- ${<prefix>.cipher_text}
- ${<prefix>.authentication_tag}
- ${<prefix>.plaintext}
Cluster Properties
None
Properties
Setting | What You Should Know... |
Source Payload | Message/data to be signed and or decrypted. Enter an actual string value, or existing context variable holding the message/data to be signed and or decrypted. If there is a nested JWT (for example, signed and encrypted) the context variable is ${< prefix >.plaintext}. |
Validation Method | Determines JWT validation:
Validate against an expected algorithm to avoid JWT security vulnerabilities. For more information, see this article: https://connect2id.com/products/nimbus-jose-jwt/vulnerabilities |
Key Type | Key type of the Recipient Key Context Variable: Certificate , JSON Web Key , or JSON Web Key Set .This field is enabled when the Validation Method is "Using Recipient Key From Context Variable". |
Key ID | The "kid" (key ID) parameter is used to match a specific key from the JSON Web Key Set. For more information, refer to RFC-7517. This field is enabled when the Key Type is "JSON Web Key Set".Example: Using googleapis.com as an example, their "https://www.googleapis.com/oauth2/v3/certs" endpoint returns a JSON payload containing a JSON Web Key Set (JWKS).
To verify the signature of a signed JSON Web Token (JWT) from Google:
|
Destination Variable Prefix | Variable prefix for storing the resulting data. Variable name accepts any alphanumeric character. Do not enclose the variable with the standard context variable format: ${ }. |