Before you start

You need:
This guide will help you add a CAPTCHA to your Identifier-First Login screen. To learn more, read the Getting Started guide and visit the SDK reference guide. For more information about Auth0 CAPTCHAs, read Customize Signup and Login Prompts.

Setup

Complete the Build Identifier First Login with Password guide and navigate to your local directory. In your Auth0 tenant, navigate to Dashboard > Security > Attack Protection and enable at least one challenge, then choose Auth Challenge as your CAPTCHA provider when prompted.

Create the CAPTCHA file

In your components folder, create a file called SimpleCaptcha.tsx and include the following code.

Add the component

Add the following code to the Login ID screen inside the form and after the identifier input.
{screenProvider.screen.isCaptchaAvailable ?
    <SimpleCaptcha image={screenProvider.screen.captchaImage} />
}
An example of a full code block for this screen is below.

Learn more