Create a signed JWT (JSON Web Signature - JWS)

createSignedJWT(payload, signOptions, config) → returns string

This function requires Adobe ColdFusion 2023 and up.  Not supported on Lucee, etc.

Argument Reference

payload any

The payload as a string or struct.

signOptions struct

Create the signature using the key information from the given struct

config struct

A struct with the following values:
- algorithm : algorithm used for signing.
- generateIssuedAt : boolean to indicate whether to generate "iat" field
- generateJti : boolean to indicate whether to generate "jti" field

Links more information about createSignedJWT

Sample code invoking the createSignedJWT function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub