A simple example project showing how to integrate Google reCAPTCHA v2 (Checkbox) in an ASP.NET Core MVC application. This README is formatted for GitHub so it displays correctly with headings, lists, code blocks, and links.
- Displays a reCAPTCHA v2 widget in a form
- Sends the generated token to the server
- Validates the token using Google's API
- Accepts the form only if verification succeeds
Perfect for beginners or small applications needing basic bot protection.
Create a site here: Google reCAPTCHA Admin
Choose:
- reCAPTCHA v2 → "I'm not a robot" Checkbox
Copy:
- Site Key
- Secret Key
{
"Recaptcha": {
"SiteKey": "YOUR_SITE_KEY",
"SecretKey": "YOUR_SECRET_KEY"
}
}dotnet restore
dotnet runThen open in your browser:
http://localhost:5001
- User checks the reCAPTCHA box
- Google generates a token
- Token is submitted with the form
- Server verifies the token with Google
- If verification succeeds → form is processed
- Never expose your Secret Key in public repositories
- Always verify the token on the server
This project is intentionally small and focused — ideal for demonstration, learning, or quick integration into existing apps.