Skip to main content

Use Alibaba Cloud Captcha

This guide explains how to use Alibaba Cloud Captcha as the captcha of Casdoor. The scene that you create in Alibaba Cloud decides the kind of validation, such as a slider or traceless validation.


Learning outcomes​

  • Create a captcha configuration in Alibaba Cloud.
  • Add Alibaba Cloud Captcha as a captcha provider in Casdoor.

What you need​

  • An Alibaba Cloud account and an AccessKey
  • Administrator access to the Casdoor admin console

Create a configuration in Alibaba Cloud​

  1. In the Alibaba Cloud console, open the Captcha service and click Confirm Open.

    Activation of the Captcha service

  2. In the Captcha console, click Add configuration.

    Add configuration button

  3. Fill in the form and submit it.

    Configuration form

  4. Note the scene and the app key of the configuration.

    Scene of the configuration

    App key of the configuration

  5. Note the AccessKey ID and AccessKey Secret from your profile.

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Captcha and Type to Aliyun Captcha.

  3. Set Sub type to Embed or Popup. See Sub types.

  4. Enter the Access key, the Secret access key, the Scene, and the App key. The App key is the identity prefix of your Captcha account.

    Alibaba Cloud Captcha provider in Casdoor

  5. Click Preview to check the captcha. For example, a slider scene with the Embed sub type looks like this:

    Preview of a slider captcha

  6. Save the provider.

Sub types​

Sub typeBehavior
Embed (default)Casdoor opens its captcha dialog and shows the captcha inside it
PopupCasdoor opens no dialog of its own, and the popup of Alibaba Cloud opens at once. A traceless scene starts traceless validation, and other scenes open the popup. After a failed attempt, the popup stays open for another try. If the user closes the popup, or an error occurs, Casdoor cancels the action that needed the captcha

Use Popup for scenes that need the popup mode of Alibaba Cloud, such as traceless scenes.

Add the captcha to an application​

Open the edit page of the application, add the provider on the Providers tab, and save. See Add the captcha to an application.

Alibaba Cloud Captcha in the application

See also​