Giter VIP home page Giter VIP logo

aspnetcore-recaptchav3's Introduction

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.

aspnetcore-recaptchav3's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aspnetcore-recaptchav3's Issues

serious logical mistake

Posting to the server after testing from the client is a serious error. In this case; The server's post method can be called by unwanted requests.
It should be verify every post method body...

        grecaptcha.execute('@siteKey', { action: 'homepage' }).then(function (token) {
            $.getJSON("/Home/Verify?token=" + token,
                function (data) {
                    if (data) {

//it seems ok but request could be passed unwanted requests.
$('form').unbind('submit').submit();
}
else {
document.location="@Url.Action("Error", "Home")";
}
});
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.