# How to enable Google reCaptcha using auth0-lock in React

**URL:** <https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [May 29, 2024, 11:26am UTC](https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192 "2024-05-29T11:26:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaymdev](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jaymdev](https://community.auth0.com/u/jaymdev)\
**Post date:** [May 29, 2024, 11:26am UTC](https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192/1 "2024-05-29T11:26:46Z")

</div>

Hello,

I’m using auth0-lock since 5+ years in my web-app for authtication.

Now, I want to add Google reCaptcha support in login/signup.

I tried looking in many docs but not found any document that can help me in this.

Really appreciate the support if you can guide me on this.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 29, 2024, 9:42pm UTC](https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192/3 "2024-05-29T21:42:17Z")

</div>

Hi @jaymdev,

Welcome to the Auth0 Community!

To enable the Google reCaptcha for your applications, you will need to enable [Bot Detection](https://auth0.com/docs/secure/attack-protection/bot-detection). However, to do so, you must use the Universal Login.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/5/8/584b31adce93e561cd5aa3b189b431102ae55562.png)  
(Reference: [Bot Detection - Restrictions and Limitation](https://auth0.com/docs/secure/attack-protection/bot-detection#restrictions-and-limitations))

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![jaymdev](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jaymdev](https://community.auth0.com/u/jaymdev)\
**Post date:** [May 30, 2024, 10:46am UTC](https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192/4 "2024-05-30T10:46:37Z")

</div>

Hi @rueben.tiow  
Thank you so much for the reply.

Yes, I’ve enabled the Bot Detection and added required thing in Google Re-Captcha.

**But How can I add google re-Capatcha in auth0-lock ?**

I don’t found any document that tells, what to modify in code to enable captcha in auth0-lock.

Here is my code snippet:

```auto
const lock = new Auth0Lock(
    process.env.AUTH0_CLIENT_ID,
    process.env.AUTH0_DOMAIN,
    {
      configurationBaseUrl: "https://cdn.auth0.com",
      autoclose: true,
      allowSignUp: true,
      avatar: null,
      closable: true,
      initialScreen: "login",
      auth: {
        sso: false,
        oidcConformant: false,
        responseType: "token id_token",
        redirect: false,
        redirectUrl: window.location.origin,
        params: {
          scope: "openid profile email user_metadata app_metadata picture"
        }
      },
      languageDictionary: {
        title: "Test Title"
      },
      theme: {
        logo: "LOGO_URL",
        primaryColor: "#00a857"
      },
    }
);

  const showLock = async () => {
    return new Promise((resolve, reject) => {
      lock.on("authenticated", (authResult: any) => {
        const { accessToken, idToken } = authResult
        lock.getUserInfo(accessToken, function (error: any, profile: any) {
          lock.hide()
          resolve({
            accessToken,
            idToken
          })
        })
      })
      lock.show()
    })
  }
  try {
    const lockResponse: any = await showLock();
  }

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [May 30, 2024, 3:59pm UTC](https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192/5 "2024-05-30T15:59:24Z")

</div>

Hi @jaymdev,

Thanks for your update.

If you’re using embedded login with Auth0 `lock.js`, then the Google reCaptcha is not supported.

See the screenshot in my initial post.

You **must** use the Universal Login for Bot Detection to work.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 13, 2024, 3:59pm UTC](https://community.auth0.com/t/how-to-enable-google-recaptcha-using-auth0-lock-in-react/135192/6 "2024-06-13T15:59:26Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
