Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Tester reCAPTCHA sur un site Web de démonstration
Ce document explique comment déployer un site Web de démonstration sur Google Cloud. Il s'agit d'un exemple de site Web intégré à reCAPTCHA qui vous permet de comprendre comment fonctionne reCAPTCHA.
Un site Web de démonstration vous aide à :
Comprendre l'expérience de vos utilisateurs avec reCAPTCHA
Utilisez-le comme référence pour intégrer reCAPTCHA à votre propre application.
Testez différentes approches de frontend et de backend en modifiant le code source de l'exemple d'application.
Vous pouvez déployer un site Web de démonstration dans l'un des langages suivants : Java, Node.js ou Python.
Pour un projet Google Cloud , vous ne pouvez déployer qu'un seul site Web de démonstration à la fois.
Avant de commencer
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
In the Principal column, find all rows that identify you or a group that
you're included in. To learn which groups you're included in, contact your
administrator.
For all rows that specify or include you, check the Role column to see whether
the list of roles includes the required roles.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Test reCAPTCHA in a demo website\n================================\n\nThis document shows you how to deploy a demo website on Google Cloud, which is a\nsample website integrated with reCAPTCHA, to\nunderstand how reCAPTCHA works.\n\nA demo website helps you do the following:\n\n- Understand your users' experience with reCAPTCHA.\n- Use as a reference to integrate reCAPTCHA in your own application.\n- Experiment with different frontend and backend approaches by editing the sample application source code.\n\nYou can deploy a demo website in one of the following languages: Java,\nNode.js, or Python.\n\nFor a Google Cloud project, you can deploy only one demo website at\na time.\n| **Note:** When you deploy a demo website, it is deployed on your Cloud Shell VM. The demo site is visible only to you and not to the other members of the project.\n\nBefore you begin\n----------------\n\n1.\n\n\n In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n\n \u003cbr /\u003e\n\n2.\n\n\n Enable the reCAPTCHA Enterprise API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=recaptchaenterprise.googleapis.com)\n\n \u003cbr /\u003e\n\n3.\n\n\n Make sure that you have the following role or roles on the project:\n\n reCAPTCHA Enterprise Admin, reCAPTCHA Enterprise Agent\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\n \u003cbr /\u003e\n\n4. If you have previously deployed a demo website, delete the relevant\n demo key.\n\nDeploy a demo website\n---------------------\n\n1. In the Google Cloud console, go to the demo website page.\n\n [Go to demo website](https://console.cloud.google.com/security/recaptcha/demo)\n2. In the **Language** list, select a language.\n\n The entire deployment process might take about 1 minute.\n3. If prompted, authorize Cloud Shell to make calls using your\n credentials.\n\n4. To navigate to your new demo **Key details** page, click **View site**.\n\n5. To view the demo website, in the **Frontend** card, click\n **View sample web page**.\n\n The demo website opens in a separate tab.\n6. To learn the patterns for integrating\n reCAPTCHA with your website, click through the examples.\n\n7. If you want to make changes to the demo website, do the following:\n\n 1. In the **Key details** page, click **Edit source**.\n 2. In the Cloud Shell Editor, find the required files in the\n **Explorer** and edit them as required.\n\n The saved changes to the source code get reloaded into the demo\n website.\n\n Don't close the Cloud Shell Editor because it closes\n Cloud Shell and stops the demo website.\n\n| **Warning:** Don't use the demo key in a production environment because its configuration is specific to demo environments. For instructions to create a new key, see [Create reCAPTCHA keys for websites](/recaptcha/docs/create-keys-websites).\n\nWhat's next\n-----------\n\n- [Get started with reCAPTCHA](/recaptcha/docs/implementation-workflow)."]]