JCaptcha Application
CAPTCHA implementation using JCaptcha |
Type | XAR |
Category | Application |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Bundled With | XWiki Standard (XWiki 10.8RC1+) |
Compatibility | XWiki 10.8RC1+ |
Table of contents
Description
Extension to the CAPTCHA Application using the JCaptcha offline library.
This extension uses the latest JCaptcha 2.0-alpha1 release that is still available. While the JCaptcha project is currently unmaintained, the library continues to function very well and is powerful and extensible enough to produce quality CAPTCHAs in 3 different formats:
- Image
- Sound
- Text
From the "Administration >> CAPTCHA" section, you can enable and configure the JCaptcha Application and select which CAPTCHA type you want to use and which implementation for the specified type:
Each displayed CAPTCHA can be refreshed, in case it is not readable enough.
Available Implementations
The JCaptcha Application exposes the standard provided CaptchaEngine implementations for each type:
Image
- Default Gimpy (Gmail)
- Simple List
- Non Linear Text Gimpy
- Hotmail
- Deformed Baffle List Gimpy
- Baffle List Gimpy
- Hotmail 2008
Sound
Sound CAPTCHAs are displayed generically with a "Listen" button, but the sound played depends on the implementation you choose:
- Speller
- Simple List
Text
- Simple Math
Custom Implementation
The JCaptcha API allows you to implement your own CaptchaEngine, giving you complete freedom in how you want to generate and display your CAPTCHA.
A very basic example you can have a look at is SimpleMathCaptchaEngine which just extends GenericCaptchaEngine and exposes the MathCaptchaFactory, which,in turn, is a TextCaptchaFactory and the CaptchaFactory is really the one in charge of generating a CAPTCHA. A CaptchaEngine can have one or more factories which are usually selected by random when generating a new CAPTCHA.
The easiest and recommended way to understanding how to implement your own CAPTCHA is to have a look at the sources of the standard provided implementations for each type:
- http://svn.code.sf.net/p/jcaptcha/code/tags/V2_0_alpha_1/jcaptcha/src/main/java/com/octo/captcha/engine/image/gimpy/
- http://svn.code.sf.net/p/jcaptcha/code/tags/V2_0_alpha_1/jcaptcha/src/main/java/com/octo/captcha/engine/sound/
- http://svn.code.sf.net/p/jcaptcha/code/tags/V2_0_alpha_1/jcaptcha/src/main/java/com/octo/captcha/text/math/
Once you're happy with the custom CaptchaEngine implementation that you have produced, head over to "Administrations >> CAPTCHA", select the type of CAPTCHA your engine produces (image/sound/text) and check "Custom" while providing in the text input next to it the full Java class name (package.class) for your implementation. Be aware that your implementation needs to have a no-parameter constructor so that it can easily be instantiated and used.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-captcha-jcaptcha-ui 16.9.0):
- org.xwiki.platform:xwiki-platform-captcha-ui 16.9.0
- org.xwiki.platform:xwiki-platform-captcha-jcaptcha-webjar 16.9.0