> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-add-auth0-cli-management-api-examples.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cas d’utilisation : Configurer un formulaire de profil progressif à l’aide des formulaires

> Apprenez à configurer un formulaire de profil progressif à l’aide de Formulaires pour actions

<Card title="Avant de commencer">
  1. Créez une [application machine-machine](https://auth0.com/docs/get-started/auth0-overview/create-applications/machine-to-machine-apps) avec les permissions suivantes activées :

  * `read:users`
  * `update:users`
  * `create:users`
  * `read:users_app_metadata`
  * `update:users_app_metadata`
  * `create:users_app_metadata`

  2. Ajoutez une [Connexion au coffre-fort](/docs/fr-ca/customize/forms/vault) en utilisant les informations d’identification de l’application machine-machine (M-M).
</Card>

Les formulaires pour les actions vous permettent de créer des flux de profilage progressif pour décider quand inviter les utilisateurs à fournir des informations manquantes, telles que le nom de l’entreprise et le poste, et de les stocker en tant qu’attributs `user_metadata`.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=37043d16784d093eb9d857d3799e77eb" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="638" height="638" data-path="docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=280&fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=fec5f676285e4d63d936db97c7ba5418 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=560&fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=15b0b5b531c4f697a8e79b203e6ccad2 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=840&fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=15975a2d48ffc6c3cedc2ee87da63579 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=1100&fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=8172f8bb9f6604771590af415fec416b 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=1650&fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=eae641abbb35c76afd9dbb50c7cf3aa5 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/yZ9Po-j-ijT7yVPZ/docs/images/fr-ca/cdy7uua7fh8z/xUx9YmnHvnAqL19JvNtNP/60dae88f893d4ebe8e3523421e960596/Progressive-profle-overview.png?w=2500&fit=max&auto=format&n=yZ9Po-j-ijT7yVPZ&q=85&s=9ef46cf3e389e15c9fb708b784de13cc 2500w" />
</Frame>

Les sections ci-dessous décrivent comment créer un Formulaire de profil progressif en utilisant des nœuds et des flux, ainsi que les étapes pour ajouter votre formulaire à une action [post-connexion](/docs/fr-ca/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger).

## Créer un formulaire à partir de zéro

Suivez ces étapes pour créer un formulaire afin de recueillir des informations :

1. Ouvrez l’éditeur de formulaires en sélectionnant **Auth0 Dashboard (tableau de bord Auth0) > Actions > Forms (formulaires).**
2. Sélectionnez **Créer un formulaire** > **Commencer à partir de zéro**.

Par défaut, un nouveau formulaire contient un nœud Début, un nœud Étape et un nœud Éran fin.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=1039a92303abd888da92ed6e40256eda" alt="Dashboard > Forms > Use Cases > Form" data-og-width="1234" width="1234" data-og-height="371" height="371" data-path="docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=280&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=7c2fa3be6ed3fd64d09977cde6fad6d1 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=560&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=ed09c053936f9472097ffcee7e482c13 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=840&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=a53e4d935aeffa2e78cc8e2d1bc44bb3 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=1100&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=c6fc5eb8dc2ec0be5102c2bbef508a09 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=1650&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=b69fe5079e8496914572e9a5079b1e78 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/wLe8GOohm066767F/docs/images/fr-ca/cdy7uua7fh8z/2TZ9jSjgEcARFpULI6hz4R/a4319a1bd482f2ee5cc23100fdb2f42c/New-form-Forms-for-action-use-case.png?w=2500&fit=max&auto=format&n=wLe8GOohm066767F&q=85&s=7c5f519c3f0cf4d25c87326c1629519e 2500w" />
</Frame>

### Configurer le nœud d’étape

Le nœud d’étape est l’interface graphique présentée aux utilisateurs. Ajoutez des [Champs](/docs/fr-ca/customize/forms/nodes-and-components) au nœud d’étape pour obtenir le nom de l’entreprise de l’utilisateur et les valeurs d’intitulé de son poste en procédant comme suit :

1. Faites glisser un champ **Rich text (Texte enrichi)** depuis le **Components menu (Menu composants)** dans le nœud **d’étape**.

   * **Rich text (Texte enrichi)** : saisissez un message personnalisé.

     * **Exemple** : `Complétez votre profil! Nous avons besoin que vous complétiez votre profil pour personnaliser votre expérience.`
   * Sélectionnez **Save (Enregistrer)**.
2. Faites glisser un champ **Text (Texte)** dans le nœud **Step (Étape)**.

   * **ID** : Saisissez `company_name`.
   * **Label (Étiquette)** : activez la case à cocher.
   * **Label (Étiquette)** : Saisissez `Company name`.
   * **Required (Requis)** : activez la case à cocher.
   * Sélectionnez **Save (Enregistrer)**.
3. Faites glisser un champ **Text (Texte)** dans le nœud **Step (Étape)**.

   1. **ID** : saisissez `job_title`.
   2. **Label (Étiquette)** : Saisissez `Job title`.
   3. **Label (Étiquette)** : activez la case à cocher.
   4. **Required (Requis)** : activez la case à cocher.
   5. Sélectionnez **Save (Enregistrer)**.
4. Sélectionnez **Publish (Publier)** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=d3658163a358a8a840d0ebe7bb09c35f" alt="Dashboard > Actions > Forms > Form > Step node" data-og-width="1404" width="1404" data-og-height="533" height="533" data-path="docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=280&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=d74c4e2e752c1c536d072a75f8809174 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=560&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=58b6e63e312b0509163f1c337586bb1b 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=840&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=b53ca51840f1d4e4a904cef40a1eacb2 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=1100&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=10b297906ad3781f9eb06fdbabf30ba7 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=1650&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=330b55f561cfa3d165f67f634232c839 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/nRFHCor-qs5SY04d/docs/images/fr-ca/cdy7uua7fh8z/6H1lRzwKyYioQyQJ9MtIoM/aa248e92fc028a68a5b92ff361a11644/progressive-profile-step.png?w=2500&fit=max&auto=format&n=nRFHCor-qs5SY04d&q=85&s=5c7457646d41ed32c08ba925b20c63d3 2500w" />
</Frame>

### Configurer le nœud Flow (Flux)

Ajoutez un nœud **Flow (Flux)** après le nœud **Step (Étape)** pour mettre à jour les `user_metadata` et reprenez le flux d’authentification en procédant comme suit :

1. Sélectionnez **Flow (Flux)** en bas de Form Editor (Éditeur de formulaire).
2. Supprimez le lien existant entre les nœuds **Step (Étape)** et **Ending Screen (Écran de fin)**.
3. Sélectionnez le nouveau **Flow (Flux)** > **Click to add a flow (Cliquer pour ajouter un flux)** > **Create a new flow (Créer un nouveau flux).**

   * Saisissez `Update user_metadata (Mettre à jour user_metadata)` dans le champ **Name (Nom)**.
   * Sélectionnez **Create (Créer)**.
   * Sélectionnez **Save (Enregistrer)**.
4. Liez le nœud **Flow (Flux)** aux nœuds **Step (Étape)** et **Ending Screen (Écran de fin)** comme illustré ci-dessous.
5. Sélectionnez **Publish (Publier)** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=b804114882756b6c4121f6fc47ef9ced" alt="Dashboard > Actions > Forms > Form" data-og-width="1404" width="1404" data-og-height="540" height="540" data-path="docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=280&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=f709a38c5f666b005eb7e9b078ae63a5 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=560&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=f206790a6e699f836d02a57f0e788da7 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=840&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=cb0273d815716d8f51606c378a21abfe 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=1100&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=b0d41703c7317f164497c292e063ed42 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=1650&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=355cf9dec354e4c4eeec9154323fb9eb 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/kxl-mWSKwl8FQgkM/docs/images/fr-ca/cdy7uua7fh8z/5C91DaWn4LGtJT9BF87ssu/095171d0c452a287c44bfde12fd6d13f/link-nodes.png?w=2500&fit=max&auto=format&n=kxl-mWSKwl8FQgkM&q=85&s=d5364e1526041d43f6bc4d9a473404fd 2500w" />
</Frame>

Ajoutez une action de mise à jour d’utilisateur Auth0 au flux en suivant ces étapes :

1. Sélectionnez le flux **Update user\_metadata** puis sélectionnez **Edit Flow (Modifier le flux)** pour ouvrir l’éditeur de flux dans un nouvel onglet.
2. Sous l’action **Start (Démarrage)** , sélectionnez l’icône **+** pour ajouter une action **Update user (Mise à jour de l’utilisateur)**. Remplissez les champs ci-dessous, puis sélectionnez **Save (Enregistrer)** pour continuer.

   * **Connection** : dans la liste déroulante, sélectionnez la connexion au coffre-fort de votre application de communication entre machines.

   * **User ID** (ID utilisateur) : Saisissez `{{context.user.user_id}}`.

   * **Body (Corps)** : Copiez et collez le code suivant pour mettre à jour user\_metadata avec les propriétés `job_title` et `company_name`.

     ```
     {
       "user_metadata": {
         "job_title": "{{fields.job_title}}",
         "company_name": "{{fields.company_name}}"
       }
     }
     ```

   * Sélectionnez **Save (Enregistrer)**.
3. Sélectionnez **Publish (Publier)** pour enregistrer.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=33769c5d623ad0ff63b25def2d43b4a1" alt="Dashboard > Actions > Forms > Flows" data-og-width="1404" width="1404" data-og-height="244" height="244" data-path="docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=280&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=93dd28231a56f9b5466f7ee5aaecaaa0 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=560&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=84388eccf7a0de6aef740f4ccaddc3fb 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=840&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=4901e0397c944c911458b561f2bb01a2 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=1100&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=f28e1116f08a03681b0f8212966cd95d 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=1650&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=2a0b10da25dfad3c152d118081352af7 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/S9mDwCjebf9to_Nj/docs/images/fr-ca/cdy7uua7fh8z/65Jx4W5oIZJyyvA8z4HqIx/0661b1a8ca6361c54fc4fef07ba59f0b/update-user.png?w=2500&fit=max&auto=format&n=S9mDwCjebf9to_Nj&q=85&s=0dfef5cf73c403f0078056576dde1549 2500w" />
</Frame>

### Récupérer le code de rendu du formulaire

Récupérez le code de rendu du formulaire pour afficher visuellement le formulaire avec une Action post-connexion personnalisée en suivant ces étapes :

* Dans l’éditeur de formulaires, sélectionnez **\<> Render (Rendre)**.
* Sélectionnez **Copy (Copier)**.

<Frame>
  <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=5267ce173107c33f0d2e7ff094c2be04" alt="Dashboard > Actions > Forms > Form > Embed" data-og-width="1400" width="1400" data-og-height="848" height="848" data-path="docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=280&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=0029a86ad4797d2c1b39754225ca9efa 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=560&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=cfe5d896ec546364a226ed87c802afc8 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=840&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=6a1681dd06ba3bb345573144e5c5134c 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=1100&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=877d947f4ff88a5526f03b617e899ae6 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=1650&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=a69c2f74851b61015a551ae8acdc225b 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/2EIUzc539sq9lwoTKbjoJv/496a864c0fc44a782c9cadca119dbfb0/embed.png?w=2500&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=61bd0b4c358a0d42d3f23b50112bfdd0 2500w" />
</Frame>

## Créer une action post-connexion

Créez une action post-connexion pour afficher votre formulaire en suivant ces étapes :

1. Rendez-vous à **Auth0 Dashboard > Actions > Flows (Flux) > Login (Connexion).**
2. Sélectionnez l’icône **+**, puis **Build from scratch (Créer de A à Z)** :

   * **Name (Nom)** : Saisissez `Render Progressive Profile Form (Rendre le formulaire de profil progressif)`.
   * **Trigger (Déclencheur)** : sélectionnez `Login / Post Login`.
   * **Runtime (Temps d’exécution)** : sélectionnez la version recommandée.
3. Sélectionnez **Create (Créer)**.

Pour configurer l’action post-connexion :

1. Supprimez le code existant dans l’éditeur de code.

2. Collez le code d’intégration du formulaire dans l’éditeur de code.

3. Modifiez le code pour définir la logique conditionnelle d’affichage du formulaire.

   ```javascript lines theme={null}
   /**
   * @param {Event} event - Details about the user and the context in which they are logging in.
   * @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
   */
   exports.onExecutePostLogin = async (event, api) => {
     const FORM_ID = 'REPLACE_WITH_YOUR_FORM_ID';

     if (
       event.stats.logins_count > 2 &&
       !event.user.user_metadata.company_name &&
       !event.user.user_metadata.job_title
     ) {
       api.prompt.render(FORM_ID);
     }
   }

   exports.onContinuePostLogin = async (event, api) => { }
   ```

   <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
     L’exemple de code ci-dessus affiche le formulaire lorsqu’un utilisateur a un nombre de connexions supérieur à 2 et que les propriétés company\_name et job\_title des métadonnées de l’utilisateur sont manquantes.
   </Callout>

4. Sélectionnez **Deploy (Déployer)**.

5. Glissez et déposez l’Action **Render Progressive Profile Form (Rendre le formulaire de profil progressif)** dans le flux **Login (Connexion)**.

   <Frame>
     <img src="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=96e61a6e9357e34a2863983fd994e5f4" alt="Dashboard > Forms > Use Cases Progressive Profile Login Action" data-og-width="1079" width="1079" data-og-height="524" height="524" data-path="docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=280&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=110b9fe0656215e50533b57b92c8deed 280w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=560&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=d2ef878f56d99e60074dd1703ee7c5be 560w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=840&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=ee01de1ea40d4b21b9ef09bc36e1fdb9 840w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=1100&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=e085b314cec66020c64608071c8fda66 1100w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=1650&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=df10fd2c399d166a9d1f096f7b1d8576 1650w, https://mintcdn.com/docs-dev-docs-add-auth0-cli-management-api-examples/-MbmGSrLY3cj_-ND/docs/images/fr-ca/cdy7uua7fh8z/1QjjZdpTqTxx012UDN4xk9/99fba5ef4068a5688f1762eea7f42976/renderprogessiveprofile.png?w=2500&fit=max&auto=format&n=-MbmGSrLY3cj_-ND&q=85&s=329a60c260e953072cbb27aa332cdf2e 2500w" />
   </Frame>

6. Sélectionnez **Apply (Appliquer)**.

### Tester la mise en œuvre

Testez la mise en œuvre en procédant comme suit :

1. Se connecter avec un utilisateur existant dont le nombre de connexions est supérieur à 2 et dont les attributs `user_metadata` `company_name` et `job_title` n’ont pas de valeurs.
2. L’action post-connexion dans le flux de connexion affichera le formulaire et demandera des informations.
3. Sélectionnez **Auth0 Dashboard > User Management (Gestion des utilisateurs) > Users (Utilisateurs),** localisez l’utilisateur et vérifiez que les attributs `user_metadata` `company_name` et `job_title` contiennent des informations.
