> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-fix-update-domain-refs.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-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=f5a8ac392b2527ff0e09992281445d1f" 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-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=280&fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=c8f9e389a0286671a629c674f85327a7 280w, https://mintcdn.com/docs-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=560&fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=3235a9f0903d452f4c9b0517fb4af45b 560w, https://mintcdn.com/docs-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=840&fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=538108617442632c1f03d0ed21cf599c 840w, https://mintcdn.com/docs-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1100&fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=96b3c61154e78a4d6cfb2f500de993ca 1100w, https://mintcdn.com/docs-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1650&fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=0917a3f0314c4076bd58dfbc8dbd9556 1650w, https://mintcdn.com/docs-staging-fix-update-domain-refs/cQV4E0rGNtMa8Ri_/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=2500&fit=max&auto=format&n=cQV4E0rGNtMa8Ri_&q=85&s=6bc2882b31037554fce46f3325690cb7 2500w" />
</Frame>

## Signer un jeton Web JSON

Génère un jeton Web JSON.

<Frame>
  <img src="https://mintcdn.com/docs-staging-fix-update-domain-refs/ZLMh4FowXjfpBfg7/docs/images/fr-ca/cdy7uua7fh8z/3XQqUMKrmrc8fUkCsDhI2T/43f7f8d38673d8fa4f9dba7242e044d9/sign-json-web-token.png?fit=max&auto=format&n=ZLMh4FowXjfpBfg7&q=85&s=ef2df394b572ff824fad4a3da719e51b" 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-staging-fix-update-domain-refs/u1He5pflxJIJglyq/docs/images/fr-ca/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png?fit=max&auto=format&n=u1He5pflxJIJglyq&q=85&s=731e4f3564dacc6cbca2de8b2965c6c3" 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-staging-fix-update-domain-refs/prK5CE_aJWbmdQVI/docs/images/fr-ca/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=prK5CE_aJWbmdQVI&q=85&s=c6bf8eac757256d0e842fdbd225ded55" 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"
}
```
