概述
Casdoor可以配置为支持不同的验证码,以验证操作是否由人类执行。 通过添加验证码提供商并在应用程序中应用它,当用户登录、注册或忘记密码并需要发送代码时,将出现一个验证码检查对话框,以验证操作是否由人类执行。
目前,Casdoor支持多个验证码提供商。 以下是Casdoor支持的提供商:
| 默认 | Cloudflare 旋转门 | reCAPTCHA | hCaptcha | 阿里巴巴云验证码 | Geetest |
|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
我们将向您展示如何应用验证码并将其添加到Casdoor。
添加验证码提供商
- 导航至您的Casdoor首页。
- 点击顶部栏中的
Providers。 - 点击
Add,然后你会在顶部列表中看到一个新的提供商。 - 点击新的提供商以修改它。
- 在
Category中选择Captcha。 - 在
Type中选择你需要的验证码提供商。 - 填写最重要的信息。 不同的验证码提供商可能需要填写不同的信息。
在应用程序中应用
- 点击顶部栏中的
Application,然后选择一个应用进行编辑。 - 点击提供商添加按钮,并选择你刚刚添加的提供商。
- Configure the provider rule to control when CAPTCHA verification appears:
- None: Disables CAPTCHA completely - no verification modal will appear
- Dynamic: Shows CAPTCHA after 5 failed login attempts
- Always: Requires CAPTCHA for every login attempt
- Internet-Only: Shows CAPTCHA only for public internet requests

We also provide a demo video to demonstrate the differences in rules, which we hope will be helpful to you.
提示
Disabling CAPTCHA To completely disable CAPTCHA verification, set the provider rule to None. This is different from SMS/Email providers where "None" means "apply to all scenarios". For CAPTCHA, "None" specifically means the verification is disabled.