Create JWTAccessToken

The JWTAccessToken action creates a JSON Web Token (JWT).

For more information, see JWT documentation.

The following table shows the parameters for the Create JWTAccessToken action.

Table 1. Create JWTAccessToken action parameters
Name Data type Relationship Required Notes®
Header KeyValuePairs Subelement Yes The set of name/value pairs that form the JWT header. For more information, see Table 2
Payload KeyValuePairs Subelement Yes The set of name/value pairs that form the JWT payload. For more information, seeTable 3
Secret String Subelement Yes In V1, the Secret must be a Base64 PKCS8 PEM file. In V2 or later, it can be either a PVKS1 or PVKS8 PEM file, and can be entered as plain text or Base64 encoded. For more information, see Table 4
savePath JPath Attribute Yes The location in the state to store this value.
Table 2. Header structure
Name Data type Description Required Notes
name String The name of the header. Yes
value String The value of the header. No  
Table 3. Payload structure
Name Data type Description Required Notes
name String The name of the payload. Yes
value String The value of the payload. No  
Table 4. Secret structure
Name Data type Description Required Notes
value String The value of the secret. No

XML Example

This action creates a JWT with the provided header, payload and secret values, and saves it in the State at location /access_token.

<CreateJWTAccessToken savePath="/access_token">
    <Header>
        <Value name="alg" value="HS256" />
        <Value name="typ" value="JWT" />
    </Header>
    <Payload>
        <Value name="iss" value="${/api_key}" />
    </Payload>
    <Secret value="${/api_secret}" />
</CreateJWTAccessToken>