> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.generaltranslation.app/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 Vault connection

To configure a Vault connection for your JSON Web Token actions using **HS256 algorithm**, you will need a **Secret:**

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=2b0a66c13698e7f7442bdd507575e080" alt="Dashboard > Actions > Forms > Flows > actions > JSON web token" data-og-width="1404" width="1404" data-og-height="697" height="697" data-path="docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=280&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=b58e2a06412cdbb64e8392b03bf5a192 280w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=560&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=87315bfb88802d8833ad59ec0f37c2e1 560w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=840&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=4c78003bc94dacd175bbbba64eec0dbc 840w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1100&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=b22d52ce453b31724ad5ca50fff4550b 1100w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1650&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=9d5539b9fbf6445f504aae98269a2607 1650w, https://mintcdn.com/generaltranslationinc/6Eil8sR_4nvgRMz0/docs/images/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=2500&fit=max&auto=format&n=6Eil8sR_4nvgRMz0&q=85&s=d9d5344b98acbb0ff4e643ba65e204ae 2500w" />
</Frame>

## Sign JSON web token

Generates a JSON web token.

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

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Payload</td>

      <td>
        Data to encode. We recommend to format it according to OpenID standards.
      </td>
    </tr>

    <tr>
      <td>Subject</td>

      <td>
        Identifies the subject of the JWT.
      </td>
    </tr>

    <tr>
      <td>Issuer</td>

      <td>
        Identifies principal that issued the JWT.
      </td>
    </tr>

    <tr>
      <td>Audience</td>

      <td>
        Identifies the recipients that the JWT is intended. For example:  admin.your\_domain.com
      </td>
    </tr>

    <tr>
      <td>Expires in</td>

      <td>
        Identifies the expiration time on and after which the JWT must not be accepted for processing.
      </td>
    </tr>
  </tbody>
</table>

### Output object

<table class="table">
  <thead>
    <tr>
      <th><b>Property</b></th>
      <th><b>Type</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>token</code></td>
      <td>String</td>
      <td>A JSON web token string.</td>
    </tr>
  </tbody>
</table>

### 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/generaltranslationinc/KrAMlK2KdiUaZm4a/docs/images/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png?fit=max&auto=format&n=KrAMlK2KdiUaZm4a&q=85&s=60fbcba0e18ff8e17068fa29f2eae5df" alt="" width="1404" height="660" data-path="docs/images/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png" />
</Frame>

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Token (required)</td>

      <td>
        JSON web token string that will be decoded.
      </td>
    </tr>
  </tbody>
</table>

### Output object

<table class="table">
  <thead>
    <tr>
      <th><b>Property</b></th>
      <th><b>Type</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>payload</code></td>
      <td>object</td>
      <td>The decoded and valid JSON web token content</td>
    </tr>
  </tbody>
</table>

### 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/generaltranslationinc/US4r8ss18ta5OCdS/docs/images/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=US4r8ss18ta5OCdS&q=85&s=73cebb019933f6acce670ba6e33dbba8" alt="" width="1404" height="882" data-path="docs/images/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png" />
</Frame>

### Input settings

<table class="table">
  <thead>
    <tr>
      <th><b>Parameter</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Token (required)</td>

      <td>
        JSON web token string that will be verified.
      </td>
    </tr>

    <tr>
      <td>Issuer</td>

      <td>
        The issuer of the JWT that will be verified.
      </td>
    </tr>

    <tr>
      <td>Audience</td>

      <td>
        The recipient audience of the JWT is intended that will be verified.
      </td>
    </tr>
  </tbody>
</table>

### Output object

<table class="table">
  <thead>
    <tr>
      <th><b>Property</b></th>
      <th><b>Type</b></th>
      <th><b>Description</b></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>valid</code></td>
      <td>Boolean</td>
      <td>Returns <code>true</code> or <code>false</code> depending on whether or not the JWT has a valid signature.</td>
    </tr>

    <tr>
      <td><code>cause</code></td>
      <td>String</td>
      <td>If the <code>valid</code> property is <code>false</code> a message is displayed.</td>
    </tr>

    <tr>
      <td><code>payload</code></td>
      <td>Object</td>
      <td>The decoded and valid JSON web token content.</td>
    </tr>
  </tbody>
</table>

### 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"
}
```
