TimothyMeadows / reCAPTCHA.AspNetCore

Google reCAPTCHA v2/v3 for .NET Core 3.x
MIT License
144 stars 51 forks source link

Implementation on Razor Pages #82

Closed gokujax closed 4 years ago

gokujax commented 4 years ago

How to implement the package on Razor Pages using localhost as "Site" of RecaptchaSettings?

TimothyMeadows commented 4 years ago

Google does not exactly support localhost, however you can add localhost (unadvised for security reasons) to your white list in your site keys domains list. Better yet if your testing you can use the official test keys from google.

Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe

These are designed for localhost use and do not require domain matching but does contain a red error message at all times about them being test keys.