> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-feat-anonymous-sessions.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-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=cc12ce7009d679fe6b73b4059ce51487" 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-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=280&fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=e352b8492717a681dd494f9dea07333d 280w, https://mintcdn.com/docs-dev-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=560&fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=376378533a8e23a26c22f95f75f4832a 560w, https://mintcdn.com/docs-dev-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=840&fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=d3dbcf76ce008f8043b6ed0c892a2af0 840w, https://mintcdn.com/docs-dev-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1100&fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=35d99b78d33ea9f43132903584ec0768 1100w, https://mintcdn.com/docs-dev-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1650&fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=84aa68f3e1ca3ea4eb2a8fd2fc2dd58d 1650w, https://mintcdn.com/docs-dev-feat-anonymous-sessions/1yuFRY9Ogsgy43F9/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=2500&fit=max&auto=format&n=1yuFRY9Ogsgy43F9&q=85&s=2132be2506e8efc71d4f692aa90d6843 2500w" />
</Frame>

## Signer un jeton Web JSON

Génère un jeton Web JSON.

<Frame>
  <img src="https://mintcdn.com/docs-dev-feat-anonymous-sessions/A08rnfb7Goc4IY1Y/docs/images/fr-ca/cdy7uua7fh8z/3XQqUMKrmrc8fUkCsDhI2T/43f7f8d38673d8fa4f9dba7242e044d9/sign-json-web-token.png?fit=max&auto=format&n=A08rnfb7Goc4IY1Y&q=85&s=a606aac56720cbaeb44da106ed68bdc5" 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-feat-anonymous-sessions/hSgzqeki9l9wbWsh/docs/images/fr-ca/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png?fit=max&auto=format&n=hSgzqeki9l9wbWsh&q=85&s=917c4f48a6f8397fbfbe6b1583768b73" 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-feat-anonymous-sessions/O5G8MZNPH0_bzNWL/docs/images/fr-ca/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=O5G8MZNPH0_bzNWL&q=85&s=1aa7dc42b90fcb4a9b6ffb8d64d174b0" 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"
}
```
