Difference between revisions of "Google reCAPTCHA"

From WHMCS Documentation

Line 1: Line 1:
<div class="docs-alert-danger">
+
Differentiating between humans and bots (computers) is an ever-changing and more challenging task. A number of solutions have been implemented, typically involving increasing obscured text and numbers or images, such as the default 5 character verification of WHMCS.
Google reCAPTCHA version 1 has been discontinued. Please refer to the [[Google_reCAPTCHA#Migrating_to_Google_reCAPTCHA_v2|following section]] of this page for more information on migrating to reCAPTCHA v2.
 
</div>
 
  
The following information is taken in part from [https://developers.google.com/recaptcha/old/docs/customization here]
+
As bots and software have become more sophisticated, a common solution was to make the text more difficult to read, which can result in frustrated and lost potential clients.  Google's reCAPTCHA set's out to change that.  They have created a system that is easy for people, but hard for bots. By using an advanced and more secure risk analysis engine, humans and bots are more effectively differentiated.
  
===Customizing the Look and Feel of reCAPTCHA===
+
The first step in authentication is to ask the user to confirm that they are not a robot by ticking a checkbox.  While this sounds simple, Google's risk analysis engine takes a lot into account about how the user came to tick the checkbox, including how the user responds before, during, and after the action.  In cases where the engine cannot confidently differentiate, a mobile-friendly verification tool like image selection from a list may be supplied or a CAPTCHA itself.
  
====Theme====
+
Google reCAPTCHA V2 is available in WHMCS 7.0 and later.
  
To make the reCAPTCHA widget display a different theme, you first need to add the following code in your main HTML page anywhere before the <form> element where reCAPTCHA appears. WHMCS would recommend placing this in the header.tpl file of your template just before the </head> tag.
+
==Enabling Google reCAPTCHA==
  
<source lang="php">
+
[[File:ReCPATCHA Configuration.png|thumb|reCPATCHA Key Generation]]
{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
+
Google's reCAPTCHA may be enabled by following these steps:
var RecaptchaOptions = {
 
    theme : 'theme_name'
 
};
 
</script>{/literal}{/if}
 
</source>
 
  
The 'theme_name' can be one of four pre-defined options
+
* Navigate to ''Setup > General Settings > Security''
 
+
* Under the setting Captcha Type, select reCAPTCHA
<gallery widths=300px perrow=2>
+
* Visit https://www.google.com/recaptcha/admin and log into your Google account
File:red.jpg|'red' reCAPTCHA
+
* Click the "Register a new site" option, enter in a label for your key and select the "Invisible reCAPTCHA" option.
File:white.jpg|'white' reCAPTCHA
+
* Be sure to enter in your domain under the "domains" section and then accept the Google terms of service and click the Register button to finish registering your site and generating your keys.
File:blackglass.jpg|'blackglass' reCAPTCHA
+
* Copy the Site Key and Secret Key issued by Google and enter them in the fields provided in WHMCS.
File:clean.jpg|'clean' reCAPTCHA
+
* Check the ''reCAPTCHA Invisible Key'' checkbox
</gallery>
+
* Save Changes to complete the process
 
 
If you do not wish to use any of the default themes, you can create your own to match your site design. You can see how to do this @ [http://code.google.com/apis/recaptcha/docs/customization.html#Custom_Theming Custom Theme]. To use a custom theme, the theme variable must be set to 'custom'.
 
 
 
====Language====
 
 
 
By default, the language of the reCAPTCHA is English, however this can be customised to English (en), Dutch (nl), French (fr), German (de), Portuguese (pt), Russian (ru), Spanish (es) or Turkish (tr).  To change the language, you need to add some javascript to define the language to your templates.  This should be added to the pages you are using with captcha verification. To allow for multi-language environments, a language file variable is used to define the language:
 
 
 
<source lang="php">
 
{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 
var RecaptchaOptions = {
 
    theme : 'theme_name',
 
    lang: '{/literal}{$LANG.isocode}{literal}'
 
};
 
</script>{/literal}{/if}
 
</source>
 
 
 
If your language is not one supported by Google, you are able to create your own translations. More information on this at https://developers.google.com/recaptcha/old/docs/customization#custom-translations
 
 
 
===Migrating to Google reCAPTCHA v2===
 
In WHMCS version 7.0 and above, we migrated to Google reCAPTCHA version 2, as version 1 was discontinued and no longer available. If a reCAPTCHA v1 is being displayed (now with a discontinued message), you should update your WHMCS installation and templates. You will also need to visit the Google reCaptcha site and generate new keys. To do that, follow these simple steps:
 
 
 
1. Visit https://www.google.com/recaptcha/admin and log into your Google account if you're not already logged in with an active session.
 
 
 
2. Under the section "Register a new site", enter in a label for your key and then select either the "reCAPTCHA v2" option, or for best forward compatibility select the "Invisible reCAPTCHA" option.  
 
  
 
[[File:Captcha_type.png]]
 
[[File:Captcha_type.png]]
  
3. Be sure to enter in your domain under the "domains" section and then accept the Google terms of service and click the Register button to finish registering your site and generating your keys.
+
[[File:Recaptcha_config.png]]
  
4. You should now be provided with a Site Key and a Secret Key to use with your WHMCS installation.
+
==Enabling Shopping Cart Checkout Invisible Captcha==
  
[[File:Recaptcha_config.png]]
+
To enable the Invisible reCAPTCHA feature for the shopping cart, ensure the following are true:
  
More information regarding reCAPTCHA v2 can be found [[Google_No_CAPTCHA_reCAPTCHA|here]].
+
* reCAPTCHA is selected under Captcha Type
 +
* An Invisible reCAPTCHA compatible Site Key and Secret Key are entered in the appropriate fields
 +
* That the ''reCAPTCHA Invisible Key'' checkbox is checked

Revision as of 15:10, 28 June 2018

Differentiating between humans and bots (computers) is an ever-changing and more challenging task. A number of solutions have been implemented, typically involving increasing obscured text and numbers or images, such as the default 5 character verification of WHMCS.

As bots and software have become more sophisticated, a common solution was to make the text more difficult to read, which can result in frustrated and lost potential clients. Google's reCAPTCHA set's out to change that. They have created a system that is easy for people, but hard for bots. By using an advanced and more secure risk analysis engine, humans and bots are more effectively differentiated.

The first step in authentication is to ask the user to confirm that they are not a robot by ticking a checkbox. While this sounds simple, Google's risk analysis engine takes a lot into account about how the user came to tick the checkbox, including how the user responds before, during, and after the action. In cases where the engine cannot confidently differentiate, a mobile-friendly verification tool like image selection from a list may be supplied or a CAPTCHA itself.

Google reCAPTCHA V2 is available in WHMCS 7.0 and later.

Enabling Google reCAPTCHA

reCPATCHA Key Generation

Google's reCAPTCHA may be enabled by following these steps:

  • Navigate to Setup > General Settings > Security
  • Under the setting Captcha Type, select reCAPTCHA
  • Visit https://www.google.com/recaptcha/admin and log into your Google account
  • Click the "Register a new site" option, enter in a label for your key and select the "Invisible reCAPTCHA" option.
  • Be sure to enter in your domain under the "domains" section and then accept the Google terms of service and click the Register button to finish registering your site and generating your keys.
  • Copy the Site Key and Secret Key issued by Google and enter them in the fields provided in WHMCS.
  • Check the reCAPTCHA Invisible Key checkbox
  • Save Changes to complete the process

Captcha type.png

Recaptcha config.png

Enabling Shopping Cart Checkout Invisible Captcha

To enable the Invisible reCAPTCHA feature for the shopping cart, ensure the following are true:

  • reCAPTCHA is selected under Captcha Type
  • An Invisible reCAPTCHA compatible Site Key and Secret Key are entered in the appropriate fields
  • That the reCAPTCHA Invisible Key checkbox is checked