Skip to content

About

reCAPTCHA v2 Sample: Minimal ASP.NET Core MVC project demonstrating Google reCAPTCHA v2 (Checkbox) integration with server-side verification.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Google reCAPTCHA v2 in ASP.NET Core

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.


🚀 What This Project Does

  • 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.


📌 How to Use

1. Get Your reCAPTCHA Keys

Create a site here: Google reCAPTCHA Admin

Choose:

  • reCAPTCHA v2 → "I'm not a robot" Checkbox

Copy:

  • Site Key
  • Secret Key

2. Add Keys to appsettings.json

{
  "Recaptcha": {
    "SiteKey": "YOUR_SITE_KEY",
    "SecretKey": "YOUR_SECRET_KEY"
  }
}

3. Run the Project

dotnet restore
dotnet run

Then open in your browser:

http://localhost:5001

🧩 How It Works

  1. User checks the reCAPTCHA box
  2. Google generates a token
  3. Token is submitted with the form
  4. Server verifies the token with Google
  5. If verification succeeds → form is processed

🔐 Notes

  • 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.

About

reCAPTCHA v2 Sample: Minimal ASP.NET Core MVC project demonstrating Google reCAPTCHA v2 (Checkbox) integration with server-side verification.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages