> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-ai-docs-migration-poc.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-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=78dde658f1432cd7ec72ff1c584f5890" 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-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=280&fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=395362133d10d1033a0eb5a4a5eff17f 280w, https://mintcdn.com/docs-dev-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=560&fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=c7b090c4ade6f0cdc3da6b607d75ba9d 560w, https://mintcdn.com/docs-dev-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=840&fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=19967bef7b627eb5b549343bbfc3d1f6 840w, https://mintcdn.com/docs-dev-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1100&fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=17038ca2a7352ebee6c4d0f29a2acc7c 1100w, https://mintcdn.com/docs-dev-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1650&fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=2ca1c717d33f0bf91cacfb084dee79c7 1650w, https://mintcdn.com/docs-dev-docs-ai-docs-migration-poc/2PlCFpcwb3WA3wF1/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=2500&fit=max&auto=format&n=2PlCFpcwb3WA3wF1&q=85&s=7f715d69c7626328a3a98e6a0bd360bb 2500w" />
</Frame>

## Signer un jeton Web JSON

Génère un jeton Web JSON.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-ai-docs-migration-poc/qo0z7dWL_r5K1acS/docs/images/fr-ca/cdy7uua7fh8z/3XQqUMKrmrc8fUkCsDhI2T/43f7f8d38673d8fa4f9dba7242e044d9/sign-json-web-token.png?fit=max&auto=format&n=qo0z7dWL_r5K1acS&q=85&s=2444cb72e7e02d3b00b9c82ce8bd2786" 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-docs-ai-docs-migration-poc/4B3-3M6y4ZU4e0aa/docs/images/fr-ca/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png?fit=max&auto=format&n=4B3-3M6y4ZU4e0aa&q=85&s=393b00a72e660b848bc8d8baa7789ecb" 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-docs-ai-docs-migration-poc/nGpeiDq9PMeTJmEB/docs/images/fr-ca/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=nGpeiDq9PMeTJmEB&q=85&s=83b643b3db0ef8a8b16f0ece6096a802" 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"
}
```
