TABLE OF CONTENTS
- Introduction
- Captcha in Znode
- Configuring a Captcha
- Enabling/Disabling Captcha for web store:
- Implementing the Znode Captcha feature on any other pages
Introduction
CAPTCHA stands for the “Completely Automated Public Turing Test to tell Computers and Humans Apart”.
Captchas are tools that are used to differentiate between real users and automated users, such as bots. Captchas provide challenges that are difficult for computers to perform but relatively easy for humans. For example, identifying stretched letters or numbers, or clicking in a specific area. A Captcha is a type of challenge-response test used in computing to determine whether the user is human. Captcha is used mostly for security reasons, Captchas also serve as a benchmark task for artificial intelligence technologies.
Captcha in Znode
In Znode, Captcha is implemented for the Login page and Contact Us pages whose visibility is dependent on the Store-level global attribute values.
In Znode, a plain captcha is implemented using CaptchaMvcv4.0 library. CaptchaMvcv4.0 allows users to easily change or extend the current implementation of the captcha.
Configuring a Captcha
Znode database default script consists of a data script for the Global attribute required for the captcha implementation.
There are two global attributes “Is Captcha Required” and “Is Captcha Required For Login” available in the default script that is associated with global attribute group “Captcha” which is in turn associated with the global attribute family “Store”
Enabling/Disabling Captcha for web store:
Navigate to: Stores > Additional Attributes > Captcha tab
Admin users have two options from where Captcha settings can be enabled and disabled.
When the value of “Is Captcha Required for Login” is set as Yes and Store Settings are published, the Captcha is enabled for the “Login” page.
When the value of “Is Captcha Required” is set as Yes, and Store Settings are published, the Captcha is enabled on the “Contact Us” and “Feedback Form” pages.
Implementing the Znode Captcha feature on any other pages
Znode Partner/Launch teams can implement the Captcha functionality on other pages or forms like implemented on the Login and ContactUs page by using the CaptchaAuthorizationAttribute available in Znode.WebStore.Core.Extensions library by following the below steps-
Create a new global attribute appropriate to the page name (like for login page attribute code is IsCaptchaRequiredForLogin) for Store.
Associate to the existing Captcha global attribute group for Store.
Pass the new attribute code as the value of AttributeCode of the attribute CaptchaAuthorizationAttribute on the action method where it is needed as shown in the below image
The CaptchaAuthorizationAttribute attribute added on the controller action method validates the server-side captcha. The IsCaptchaValid method from the CaptchaHelper class of CaptchaMvc.HtmlHelpers determines whether the captcha is valid, and writes an error message if needed. Then captcha HTML can be added on the respective view/partial view of the action method to render captcha.
Captcha will be case insensitive by default (i.e User can add CAPTCHA with caps on or off, the application will not throw an error). Captcha case-sensitivity or case insensitivity will be configurable from the code.
For case-sensitive Captcha ZnodeCaptchaWithCaseSensitive extension needs to be used on view.
Note: If the value of IsCaptchaRequiredForLogin or IsCaptchaRequired attribute in admin is set to true then on view then it must have its HTML code added to render the captcha.