JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 80
  • Score
    100M100P100Q65588F

BotDetect Captcha AngularJS Module (JavaScript / Angular 1.x)

Package Exports

  • angularjs-captcha

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angularjs-captcha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

BotDetect Captcha AngularJS Module (JavaScript / Angular 1.x)

Quick guide:

1) Captcha AngularJS Module Installation
npm install angularjs-captcha --save
2) Include Captcha AngularJS Module in Your Web App
<script src="node_modules/angularjs-captcha/dist/angularjs-captcha.min.js"></script>
3) Add Captcha AngularJS Module to Your AngularJS Module
var app = angular.module('app', ['BotDetectCaptcha']);

app.config(function(captchaSettingsProvider) {
  ...
  
  captchaSettingsProvider.setSettings({
    captchaEndpoint: '/botdetect-java-captcha-api-path-at-server-side/botdetectcaptcha'
  });
});
4) Display Captcha In AngularJS Template
<botdetect-captcha styleName="exampleCaptcha"></botdetect-captcha>
5) Validate Captcha on the Client-side
<input 
  type="text" 
  id="captchaCode"
  name="captchaCode"
  ng-model="captchaCode" 
  correct-captcha
>
6) Validate Captcha on the Server-side

The client-side Captcha validation is just an usability improvement. Captcha protects some action on a server-side, and therefore Captcha validation has to be there as well.

Server-side Captcha validation with Java Captcha looks in this way:

// validate captcha
SimpleCaptcha captcha = SimpleCaptcha.load(request);
boolean isHuman = captcha.validate(captchaCode, captchaId);

Docs:

AngularJS CAPTCHA Integration Guide

Code Examples:

  1. Basic AngularJS CAPTCHA Example

  2. AngularJS CAPTCHA Form Example

Dependencies:

Captcha AngularJS module uses Captcha library for Captcha image and Captcha sound generaton. At the moment challenges are generated in Java backend with BotDetect Java Captcha library, but BotDetect PHP and BotDetect ASP.NET are going to work with Captcha AngularJS module soon as well.

Technical Support:

Through contact form on captcha.com.