Issue mode

In issue mode, the JWT Module creates a binary security token, which has the attribute type urn:com:ibm:JWT.

When the module creates a JWT, the following operations are performed:

  1. The keys are resolved.
  2. The claims are populated from the STSUU.
  3. The static claims are populated, if they were configured and are not already set from the STSUU.
  4. The JWT is signed if signing is set.
  5. The JWT is encrypted. If it is signed, the signed JWT will be encrypted and the claim “cty”:”jwt” will be added to the header.
  6. The binary security token is issued.

The following table shows the configuration properties.

Configuration property Description Can be provided by STSUU Context Attributes
signing.alg The algorithm with which the JWT is signed. TRUE
signing.symmetricKey The symmetric key used to perform signature validation. TRUE
signing.db The keystore from which the certificate is sourced. TRUE
signing.cert Certificate label from which the public keys are sourced. TRUE
signing.kid The Key ID used for signing. TRUE
encryption.jwksUri The JWKS URI used for encryption. TRUE
encryption.kid The Key ID used for encryption. TRUE
encryption.alg The algorithm used by the JWT for key management. TRUE
encryption.enc The algorithm used by the JWT for content encryption. TRUE
encryption.symmetricKey The symmetric key used for key management. TRUE
encryption.db The keystore from which the private key is sourced. TRUE
encryption.cert The label of the certificate containing the private key to use for decrypting the encryption key. TRUE
includeIat A Boolean value that indicates whether the iat (issued at) claim is generated and included in the JWT. This value does not override an existing iat value if it is already present. FALSE
iss The static value with which the iss (issuer) claim is populated. FALSE
aud The static value with which the aud (audience) claim is populated. FALSE
sub The static value with which the sub (subject) claim is populated. FALSE
jti JWT ID, which is a unique identifier for the JWT. A value of 0 disables the claim. FALSE
exp Offset for the exp (expiration time) claim. A value of 0 disables the claim. FALSE
nbf Offset for the nbf (not before) claim. A value of -1 disables the claim. FALSE

When the module runs in issue mode, it converts the STSUU into a JWT. The following examples show some sample input STSUU and the corresponding output JWT.

To add custom claims to a JWT header, add a custom context attribute with the type "urn:ibm:JWT:header:claim". This type is not case sensitive.

A snippet of an example attribute in XML is shown as follows:

Input example

Output example

Pre populating the JWT JSON

In some instances, a more complex and custom JSON format for the JWT might be necessary. This can be achieved by providing the context attribute “claim_json”. The value of this attribute will be parsed and used when initializing the JSON that will be the claims for the JWT. Any attributes that are present will be added to the JWT.

Attribute example:


Parent topic: JSON Web Token (JWT)