> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-event-stream-action-templates.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-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=2f661a19d0cf8b34bf9faac9ff7cd4f9" 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-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=280&fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=c467183d2088e1afc2174061014982ed 280w, https://mintcdn.com/docs-dev-docs-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=560&fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=ab0d8b7ec319e9ba561363183863e09f 560w, https://mintcdn.com/docs-dev-docs-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=840&fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=5c2093d21155f32fbc6b784cebcb87c8 840w, https://mintcdn.com/docs-dev-docs-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1100&fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=5872c51a03dc78a6596873ba65231fce 1100w, https://mintcdn.com/docs-dev-docs-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=1650&fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=bb114f94a74d85ab5ccc488b96ef3361 1650w, https://mintcdn.com/docs-dev-docs-event-stream-action-templates/i2ZmWeCuZRFq3k1v/docs/images/fr-ca/cdy7uua7fh8z/1WnUlIe2QZf39G45PHcQGp/40d768da226a0cefa09c62c5cab78577/jwt-vault-connection.png?w=2500&fit=max&auto=format&n=i2ZmWeCuZRFq3k1v&q=85&s=03715402537fc1f3515a09b73ea63d4d 2500w" />
</Frame>

## Signer un jeton Web JSON

Génère un jeton Web JSON.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-event-stream-action-templates/lVJB7tEBqNNqsQHu/docs/images/fr-ca/cdy7uua7fh8z/3XQqUMKrmrc8fUkCsDhI2T/43f7f8d38673d8fa4f9dba7242e044d9/sign-json-web-token.png?fit=max&auto=format&n=lVJB7tEBqNNqsQHu&q=85&s=50daf39c410a1ca5adcf0f750215d9cc" 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-event-stream-action-templates/1giWs3MwX5Akld9c/docs/images/fr-ca/cdy7uua7fh8z/7I25WVtppllW6qhC5sALvH/70143bbe0d96920e1d9dfabbb1d6aeff/decode-json-web-token.png?fit=max&auto=format&n=1giWs3MwX5Akld9c&q=85&s=1f01f4d8b70a6b41c96e6637074edd1b" 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-event-stream-action-templates/6a0bOHQ-5WYDVwHQ/docs/images/fr-ca/cdy7uua7fh8z/15MDJcfZqtC46h6mRPOGcz/55e0785db066a54f836d30199fa5f295/verify-json-web-token.png?fit=max&auto=format&n=6a0bOHQ-5WYDVwHQ&q=85&s=14456ae0bd4049ea432fd9ab4e4047de" 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"
}
```
