Create and verify captcha in ABP framework

Tram Ho

sequence diagram

Source at: https://github.com/ngotruong09/AbpCaptcha.git

overview

This is a captcha generator library used on the Abp framework. Main fuction:

  • [x] Create captcha
  • [x] Verify captcha

Using

Install package from nuget or clone source here to use:

Next, add [DependsOn(typeof(CaptchaModule))] to the ABP module class in your project.

Then use service ICaptchaEngine to GetCaptcha/VerifyCaptcha captcha.

How to configure

Configuration in the file appsettings.json

Or in ConfigureServices :

Meaning of some configuration parameters:

  • FontFamilies : font of captcha (image);
  • Timeout : captcha expiration time, time to wait for user to enter captcha, in seconds;
  • Pattern : the characters that can be present in the captcha;
  • SizeText : the number of characters in the captcha;
  • DrawLines : the number of lines in the captcha (mainly creating noise)
  • Width : the size of the width of the captcha
  • Height : length size of captcha

Some examples of configurations:

Share the news now

Source : Viblo