Socket
Socket
Sign inDemoInstall

angular-captcha

Package Overview
Dependencies
0
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-captcha

BotDetect Angular 2+ Captcha Module


Version published
Maintainers
1
Created

Readme

Source

BotDetect Angular Captcha Module

Requirements:

Angular Captcha module requires Captcha library to generate image&sound Captcha challenges. Currently, it works with BotDetect Java Captcha library, but ASP.NET and PHP libraries are coming soon.

Quickstart:

Step 1: Install Angular Captcha Module
npm install angular-captcha --save
Step 2: Load Angular Captcha Module

If you use SystemJS, declare the following in your SystemJS config file:

  map: {
    ...
    'angular-captcha': 'npm:angular-captcha'
  },
  packages: {
    ...
    'angular-captcha': {
      defaultExtension: 'js',
      main: 'index'
    },
Step 3: Declare Angular Captcha Module
import { BotDetectCaptchaModule } from 'angular-captcha';

@NgModule({
  imports: [
    ...
    BotDetectCaptchaModule.forRoot({
      captchaEndpoint: '/botdetect-java-captcha-api-path-at-server-side/botdetectcaptcha'
    })
  ],
  ...
})
Step 4: Displaying the Captcha Challenge
<botdetect-captcha styleName="exampleCaptcha"></botdetect-captcha>
Step 5: Client-side Captcha Validation
<input
  type="text"
  id="captchaCode"
  name="captchaCode"
  #captchaCode="ngModel"
  ngModel
  correctCaptcha
>
Step 6: Server-side Captcha Validation

The client-side Captcha validation is just UI make-up. The purpose of Captcha is to ensure some server-side action is initiated by a human. Therefore, you must validate Captcha at server-side.

If you have Java Captcha library on a server side validation would look similar to this:

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

Documentation:

Angular CAPTCHA Integration Guide

Examples:

Basic Angular CAPTCHA Example

Angular CAPTCHA Form Example

Support:

Send us questions, suggestions contact form on captcha.com.

Keywords

FAQs

Last updated on 18 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc