How to add google recaptcha

Qolby Adha asked on November 12, 2024 08:33

Could you please advise on how to add Google reCAPTCHA to the login and reset password pages? I wasn’t able to find guidance on this in the Kentico 13 documentation.

Correct Answer

Laura Frese answered on November 12, 2024 16:39

There are a few ways to skin this cat. While the keys for Captcha are added in Kentico settings, you will then need to build captcha into your Kentico 13 site. While you might be tempted to just add the scripts to the pages, I'd recommend building a view component for recaptcha that pulls the settings keys, and adding the component to the views as needed for login and password reset.

https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-components?view=aspnetcore-9.0

0 votesVote for this answer Unmark Correct answer

Recent Answers


Qolby Adha answered on November 13, 2024 05:27

Hi Laura,

Thank you for the insights! I agree that setting up a view component is a cleaner approach for integrating reCAPTCHA, especially for keeping the keys secure and manageable through Kentico settings. Implementing it this way should make it easier to reuse across views like login and password reset. I'll start by following the documentation on creating view components in ASP.NET Core that you shared.

Thanks again for the advice!

0 votesVote for this answer Mark as a Correct answer

Laura Frese answered on November 13, 2024 17:45 (last edited on November 13, 2024 17:46)

My pleasure. If you plan to migrate to xperience by Kentico at some point, consider saving captcha keys in the project app settings or azure vault instead.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.