Using CAPTCHA in an Azure AD B2C custom policy

Rory Braybrook
The new control plane
2 min readApr 22, 2024
Image of a captcha

There is very little new development in B2C. It’s pretty much code complete, but then I noticed a new feature: the CAPTCHA feature has been added.

The documentation is here.

CAPTCHA determines if an online user is a human and not a bot. CAPTCHA is an acronym for “Completely Automated Public Turing Test to Tell Computers and Humans Apart.”

As per the doc., you need to use the starter pack from:

/Display Controls Starterpack/LocalAccounts/

As usual, the custom policy is in a gist.

When you run the policy, the screen looks like this:

Image of a sign in screen with a captcha

You must correctly answer the captcha and sign in with the email address and password.

Not entering anything for the captcha shows:

Image of an error screen showing a captcha is required

Entering an incorrect value shows:

Image of an error screen showing an incorrect  captcha

Entering the correct captcha allows the user to log in.

The speech button doesn’t seem to work. I just hear a high-pitched whine.

It’s supposed to work for sign-in and sign-up, but I can’t get the sign-up link to appear?

All good!

--

--

Rory Braybrook
The new control plane

NZ Microsoft Identity dude and MVP. Azure AD/B2C/ADFS/Auth0/identityserver. StackOverflow: https://bit.ly/2XU4yvJ Presentations: http://bit.ly/334ZPt5