Google reCaptcha
reCaptcha is a free google service and uses an advanced risk analysis and adaptive Captcha's to keep away automated software from engaging in abusive activities on our site and allow valid user pass through with ease.
There are software that can increase the number of hit to the server which can impact the server functionality and if number of request rises above the server capacity, it can cause server down. Google reCaptcha can prevent such conditions.
Implementation
Step 1: First you need to sign up for reCaptcha. Go to https://www.google.com/recaptcha/intro/index.html
Sign up for reCaptcha |
Step 2: fill the information in register form and click register.
Register for reCaptcha |
Step 3: On click of register you are successfully able to generate the keys.
keys Information |
Step 4: After successfully generation of the keys now we need to use it in our application for generating reCaptcha.
Old reCaptcha:
· In your mvc application open view (.cshtml file) where you want to use reCaptch and add the following code. Replace Site/Public key with your Site key.
reCaptcha View |
· Open the controller of the above view and add FormSubmit method which is going to validate your reCaptcha. Replace Secret key with your secret key
reCaptcha controller code |
· Now browse your site to check reCaptcha. On click of create if captcha is valid Google reCaptcha validation success message will be shown otherwise reCaptcha validation failed message will be shown.
reCaptcha validation |
New reCaptcha:
· In your mvc application open view (.cshtml file) where you want to use reCaptcha and add the following code. Replace Site/Public key with your Site key.
reCaptcha view code |
· Open the controller of the above view and add FormSubmit method which is going to validate your reCaptcha. Replace Secret key with your secret key
reCaptcha controller code |
· Now browse your site to check reCaptcha. On click of Submit if check box is checked Google reCaptcha validation success message will be shown otherwise reCaptcha validation failed message will be shown.
reCaptcha validation |
· If validation failed multiple times now on checking the check box security measures will increase by increasing the strength of verification through selection of Images.
reCaptcha validation |
0 comments:
Post a Comment