> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-actions-triggers-prototype.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how to configure your JSON Web Token flow actions to sign, verify or decode JSON Web Tokens.

# JSON Web Token

This list of <Tooltip tip="JSON Web Token (JWT): Standard ID Token format (and often Access Token format) used to represent claims securely between two parties." cta="View Glossary" href="/docs/glossary?term=JSON+Web+Token">JSON Web Token</Tooltip> actions allows you to generate, verify, and decode JWTs in your flows.

## Configure your JWT Vault Connection

Learn how to configure a Vault Connection for your JSON Web Token Flow Actions at [JWT Vault Connection](/docs/customize/forms/vaults/jwt).

## Sign JSON web token

Generates a JSON web token.

<Frame>
  <img src="https://mintcdn.com/docs-staging-actions-triggers-prototype/t4yVPvTKgaZSm3UA/docs/images/cdy7uua7fh8z/3XQqUMKrmrc8fUkCsDhI2T/43f7f8d38673d8fa4f9dba7242e044d9/sign-json-web-token.png?fit=max&auto=format&n=t4yVPvTKgaZSm3UA&q=85&s=33142d5558247f7028c2627582779a70" alt="" width="1404" height="1483" data-path="docs/images/cdy7uua7fh8z/3XQqUMKrmrc8fUkCsDhI2T/43f7f8d38673d8fa4f9dba7242e044d9/sign-json-web-token.png" />
</Frame>

### Input settings

| Parameter  | Description                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------- |
| Payload    | Data to encode. We recommend to format it according to OpenID standards.                       |
| Subject    | Identifies the subject of the JWT.                                                             |
| Issuer     | Identifies principal that issued the JWT.                                                      |
| Audience   | Identifies the recipients that the JWT is intended. For example: admin.your\_domain.com        |
| Expires in | Identifies the expiration time on and after which the JWT must not be accepted for processing. |

### Output object

| Property | Type   | Description              |
| -------- | ------ | ------------------------ |
| `token`  | String | A JSON web token string. |

### Output object example

```json lines theme={null}
{
  "token": "eyJhbGciOiJIUzI1N..."
}
```

## Decode JSON web token

Decodes a provided JSON web token.

<Frame>
  <img src="https://mintcdn.com/docs-staging-actions-triggers-prototype/sLHXV70A3uVzop12/docs/images/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png?fit=max&auto=format&n=sLHXV70A3uVzop12&q=85&s=04c65a48f5a6e7d4771394e1ea14059c" alt="" width="1404" height="660" data-path="docs/images/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png" />
</Frame>

### Input settings

| Parameter        | Description                                 |
| ---------------- | ------------------------------------------- |
| Token (required) | JSON web token string that will be decoded. |

### Output object

| Property  | Type   | Description                                  |
| --------- | ------ | -------------------------------------------- |
| `payload` | object | The decoded and valid JSON web token content |

### Output object example

```json lines theme={null}
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
```

## Verify JSON web token

Verifies the JSON web token data, to determine if it remains intact or has been modified, in order to guarantee its authenticity.

<Frame>
  <img src="https://mintcdn.com/docs-staging-actions-triggers-prototype/2DQIk_7pOO3Z71x8/docs/images/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=2DQIk_7pOO3Z71x8&q=85&s=765db749a657cb6f50679391a891a040" alt="" width="1404" height="882" data-path="docs/images/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png" />
</Frame>

### Input settings

| Parameter        | Description                                                          |
| ---------------- | -------------------------------------------------------------------- |
| Token (required) | JSON web token string that will be verified.                         |
| Issuer           | The issuer of the JWT that will be verified.                         |
| Audience         | The recipient audience of the JWT is intended that will be verified. |

### Output object

| Property  | Type    | Description                                                                          |
| --------- | ------- | ------------------------------------------------------------------------------------ |
| `valid`   | Boolean | Returns `true` or `false` depending on whether or not the JWT has a valid signature. |
| `cause`   | String  | If the `valid` property is `false` a message is displayed.                           |
| `payload` | Object  | The decoded and valid JSON web token content.                                        |

### Output object example

```json lines theme={null}
{
  "valid": true,
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "Jane Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMe..."
}
```

```json lines theme={null}
{
  "valid": false,
  "cause": "INVALID_SIGNATURE"
}
```
