# JWT Generation

The JWT Generation Data Operation allows for generating JSON Web Tokens using RSA or HMAC algorithms.

![](https://3333962744-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbnBffrSN2FHLC5cM89AM%2Fuploads%2Fgit-blob-9d8fe9894488875b462d9fe64503473e4c51bf2d%2Fjwt-generation-v183-0.png?alt=media)

## Use Cases

* Generate a JWT Token for some APIs to get access

## Data Operation Properties

### Payload _(required)_

Expects type `Any`.

Contains the claims to generate the JWT token. For more information, see [https://jwt.io/introduction](https://jwt.io/introduction).

For all payloads, if `iat` is not present, then the `iat` (issued at) field is appended automatically.

### Header _(optional)_

Expects type `Any`.

It consists of two parts: the type of the token, which is JWT, and the signing algorithm being used, such as HMAC or RSA.

In case no Header is provided, `"alg"` is populated according to the chosen algorithm, and `"typ": "JWT"` is added for object payloads automatically

The `alg` property in the Header is optional, as this is automatically chosen based on the algorithm selected from the drop-down menu. But if the `"alg": ABC` is present in the Header, then `ABC` must match the algorithm selected in the drop-down

### RSA Private Key or HMAC Secret _(required)_

Expects type `Text`.

The secret (using HMAC) or public/private key pair (using RSA) to sign into the JWTs. This private key must be in PKCS1 or PKCS8 format.

### Algorithm _(required)_

The algorithm to be use to generate the JWT: HS256, HS384, HS512, RS256, RS384, or RS512

## Run Results

If successful, this data operation returns a JWT token.
