Git Product home page Git Product logo

google-nocaptcha-recaptcha's Introduction

Google-noCAPTCHA-reCAPTCHA

This repo will take you through the basic steps needed to implement a google noCAPTCHA reCAPTCHA on your website.

First of all, a little background info. The standard captchas used throughout the web where the user has to offer their response to a distorted image is outdated. They're often quite difficult to read for most users, let alone for thsoe with some form of impairment which makes this task more difficult. Final note on this, some data suggests that AI is able to crack these codes in 99.8% of attempts!

The noCAPTCHA reCAPTCHA doesn't require user input (in most cases) and simply requires the click of a checkbox to confirm 'you are not a robot'. It works a lot of magic in the backgroud checking the browser behaviour (key events, mouse events etc.) to distinguish as to whether you are a robot or a human. It also has the ability to add an extra layer of validation by making the user click on images based on a criteria in the event they feel the probability of the user not being human is not above a certain freshold.

STEPS:

i) got to https://www.google.com/recaptcha/intro/index.html and click 'GET reCAPTCHA' ii) Sign in with a google accout. iii) Add your label and domains (e.g. myNewWebsite and mynewwebsite.app/.dev...) iv) At this point, you will be given a public API key, a private API key (for your eyes only!), a js script and finally a div element. Good to go!

Implementing the above

i) Firstly, you can easily add the div element in any document where you want a captcha to be embedded (as shown in my create.blade.php file ii) Wherever this div goes, the script must follow! In this case, I have put the script in my master.blade.php file. the create.blade.php file extends this. iii) When using the captcha, this submit event in create.blade.php sends the captcha request through the TicketsController.php file where it is picked up by the public function 'store'. You will notice method injection is used here so the input is validsated by a 'TicketFormRequest' class. There are many ways to vsalidate the input, this is one. iv) If the user has successfully shown they are a human, the secret variable is assigned to my private API key. We then verify the response as shown in the store method and huzzah, in a handful of lines, you've implemented a nice little feature.

google-nocaptcha-recaptcha's People

Contributors

davidrobbo avatar

Watchers

James Cloos avatar  avatar

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.