huseyinsimsekk / AspNetCore-ReCAPTCHAv3

reCAPTCHA v3 Usage in Asp.Net Core MVC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google ReCAPTCHA V3 Usage In Asp.Net Core MVC

SS

How To Use

You can use this repository two ways:

  • You can clone or fork this repo and than you can change code what you want
  • You can look over code and than implement your code. Note that this is an example repository.

Explanation

  • First, record to google recaptcha with your google account. Register your site there and get your secret and site key.
  • Then edit GoogleRecaptcha configuration in applicationsettings.json. Also you can change Threshold value.
"GoogleRecaptcha": {
    "VefiyAPIAddress": "https://www.google.com/recaptcha/api/siteverify",
    "Sitekey": "YOUR-GOOGLE-SITEKEY-HERE",
    "Secretkey": "YOUR-GOOGLE-SECRETKEY-HERE"
  },
"RecaptchaThreshold": "0,5"
  • Then you can add your UserService.

I set 0.5 for this example. If get to you score is less than 0.5 from Google API, return error page. If score is greater that 0.5 and username-password pair is correct, you are login. Devto Post: Post

Contribute

Please feel free to send PR or issue if you think there is a wrong, mistake, or enhancement.

About

reCAPTCHA v3 Usage in Asp.Net Core MVC


Languages

Language:C# 59.4%Language:HTML 27.2%Language:CSS 11.5%Language:JavaScript 1.9%