IDaaS 系统 ArkID 一账通内置插件:图形验证码认证因素的配置流程

图形验证码插件功能介绍
图形验证码认证因素插件对用户认证凭证表单进行扩充,插入图形验证码并实现相关验证功能,是 IDaaS 一账通 ArkID 系统内置功能插件之一。
注意:图形验证码认证因素不具有认证/注册/修改密码等功能,仅对其他认证因素进行凭证元素扩充
普通用户:在 “登录” 页面实现向指定表单插入图形验证码

图形验证码认证因素配置流程
01 插件租赁
经由左侧菜单栏依次进入【租户管理】->【插件管理】,在插件租赁页面中找到图形验证码认证因素插件卡片,点击租赁

02 租户配置
租赁完成后,进入已租赁列表,找到图形验证码认证因素插件卡片,点击租户配置,配置相关数据

03 认证因素配置
经由左侧菜单栏依次进入【认证管理】-> 【认证因素】,点击创建按钮,类型选择"authcode", 无须配置相关参数,至此配置完成

实现思路
普通用户:图形验证码:

抽象方法实现
load
authenticate
register
reset_password
create_login_page
create_register_page
create_password_page
create_other_page
create_auth_manage_page
check_auth_data
fix_login_page
代码
extension_root.com_longgui_auth_factor_authcode.AuthCodeAuthFactorExtension (AuthFactorExtension)
图形验证码认证因素插件

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
authenticate(self, event, **kwargs)
抽象方法:认证
Parameters:

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
def authenticate(self, event, **kwargs): pass
check_auth_code(self, request, tenant_id, data)
校验图形验证码
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
check_auth_data(self, event, **kwargs)
响应检查认证凭证事件

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
check_authcode(self, tenant, authcode, authcode_key)
校验图形验证码
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
create_auth_manage_page(self)
认证管理页面描述
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
create_extension_config_schema(self)
创建插件运行时配置 schema 描述
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
create_extension_settings_schema(self)
创建租户配置 schama
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
create_login_page(self, event, config, config_data)
抽象方法:组装登录页面表单

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
create_other_page(self, event, config, config_data)
抽象方法:组装登录页上其他操作表单

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
create_password_page(self, event, config, config_data)
抽象方法:组装重置密码页面表单

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
def create_password_page(self, event, config, config_data): pass
create_register_page(self, event, config, config_data)
抽象方法:组装注册页面表单

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
fix_login_page(self, event, **kwargs)
向 login_pages 填入认证元素

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
generate_key(self)
生成随机 key
Returns:

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
get_authcode(self, request, tenant_id)
获取图形验证码
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
get_authcode_picture(self, auth_code_length=4, width=180, height=60)
制作验证码图片
Parameters:

Returns:

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
get_random_char(self, auth_code_length=4)
获取随机字符组合
Parameters:

Returns:

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
get_random_color(self, low, high)
获取随机颜色
Parameters:

Returns:

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
load(self)
加载插件
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
register_extension_api(self)
注册插件 API
Source code in extension_root/com_longgui_auth_factor_authcode/init.py
reset_password(self, event, **kwargs)
抽象方法:响应重置密码事件
Parameters:

Source code in extension_root/com_longgui_auth_factor_authcode/init.py
ArkID 方舟一账通
一款插件化、多租户、云原生的开源统一身份认证授权管理解决方案/身份云管理平台,采用 AGPL-3.0 开源协议;支持多种标准协议(LDAP, OAuth2, SAML, OpenID),细粒度权限控制,完整的 WEB 管理功能,钉钉、企业微信集成等。ArkID 既可以作为企业终端客户资产统一管理 CIAM,可作为企业内部雇员、外部伙伴统一身份管理平台 EIAM;助企业构建标准化的用户身份体系。如果希望快速的了解系统的基本使用,可以访问官方 IDaaS 注册账号后创建自己的租户,即可使用系统的大部分功能。如果希望体验超级管理员,安装配置插件等,推荐使用私有化部署的方式。
版权声明: 本文为 InfoQ 作者【龙归科技】的原创文章。
原文链接:【http://xie.infoq.cn/article/085c58e3dd8c6aa0c81807897】。
本文遵守【CC-BY 4.0】协议,转载请保留原文出处及本版权声明。
评论