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

# Jeton Web JSON

> Découvrez comment configurer vos actions de flux jeton Web JSON pour signer, vérifier ou décoder les jetons Web JSON.

Cette liste d’actions de jetons Web JSON vous permet de générer, de vérifier et de décoder les <Tooltip href="/docs/fr-ca/glossary?term=json-web-token" tip="Jeton Web JSON (JWT)
Format standard de jeton d’ID (et souvent de jeton d’accès) utilisé pour représenter en toute sécurité des demandes entre deux parties." cta="Voir le glossaire">JWT</Tooltip> dans vos flux.

## Configurer la connexion à votre coffre-fort

Pour configurer une connexion au coffre-fort pour vos actions de jeton Web JSON utilisant **algorithme HS256**, vous aurez besoin d’un **Secret :**

<Frame>
  <img src="https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=1ef802398e144f86e07ba024870bcbe2" 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/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=280&fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=484ec5ac350e420092cb91064c0870b0 280w, https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=560&fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=9fdf82783ca2fc113c86dc32d296015e 560w, https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=840&fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=2e5ceef15595d6190f0f46652e1f1e16 840w, https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1100&fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=19ba7de12a4a110e1cda263c83eee234 1100w, https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1650&fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=b3d34af4b5c5c8a078c76bc5e4de2a94 1650w, https://mintcdn.com/docs-dev-actions-triggers-prototype/adoBdpzp06Dk41-J/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=2500&fit=max&auto=format&n=adoBdpzp06Dk41-J&q=85&s=11fc6922d22fea428513cbaa8a8184c6 2500w" />
</Frame>

## Signer un jeton Web JSON

Génère un jeton Web JSON.

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

### Paramètres de saisie

| Paramètre    | Description                                                                                           |
| ------------ | ----------------------------------------------------------------------------------------------------- |
| Charge utile | Données à encoder. Nous vous recommandons de les formater selon les normes OpenID.                    |
| Objet        | Identifie l’objet du JWT.                                                                             |
| Émetteur     | Identifie le mandant qui a émis le JWT.                                                               |
| Audience     | Identifie les destinataires auxquels le JWT est destiné. Par exemple : Admin.your\_domain.com         |
| Expire dans  | Identifie le délai d’expiration après lequel le JWT ne doit plus être accepté aux fins de traitement. |

### Objet de sortie

| Propriété | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| `token`   | Chaîne | Une chaîne de jeton web JSON. |

### Exemple d’objet de sortie

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

## Décoder un jeton Web JSON

Décode un jeton Web JSON fourni.

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

### Paramètres de saisie

| Paramètre           | Description                               |
| ------------------- | ----------------------------------------- |
| Jeton (obligatoire) | Chaîne du jeton web JSON qui sera décodé. |

### Objet de sortie

| Propriété | Type  | Description                                   |
| --------- | ----- | --------------------------------------------- |
| `payload` | objet | Le contenu du jeton web JSON décodé et valide |

### Exemple d’objet de sortie

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

## Vérifier un jeton Web JSON

Vérifie les données du jeton Web JSON pour déterminer si elles sont intactes ou si elles ont été modifiées, afin d’en garantir l’authenticité.

<Frame>
  <img src="https://mintcdn.com/docs-dev-actions-triggers-prototype/7ZTj9ECBnaPth0zw/docs/images/fr-ca/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=7ZTj9ECBnaPth0zw&q=85&s=46dc5b899f4c27bf52e9ae4eb785fe38" alt="" width="1404" height="882" data-path="docs/images/fr-ca/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png" />
</Frame>

### Paramètres de saisie

| Paramètre           | Description                                            |
| ------------------- | ------------------------------------------------------ |
| Jeton (obligatoire) | Chaîne de jeton Web JSON qui sera vérifiée.            |
| Émetteur            | L’émetteur du JWT qui sera vérifié.                    |
| Audience            | L’audience destinataire du JWT est censé être vérifié. |

### Objet de sortie

| Propriété | Type    | Description                                                                     |
| --------- | ------- | ------------------------------------------------------------------------------- |
| `valid`   | Booléen | Renvoie `true` ou `false` selon que le JWT possède ou non une signature valide. |
| `cause`   | Chaîne  | Si la propriété `valid` est `false` un message s’affiche.                       |
| `payload` | Objet   | Le contenu du jeton Web JSON décodé et valide.                                  |

### Exemple d’objet de sortie

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