GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
  • Single Page Web Application

  • Mobile and Client Applications

    • Android

    • C#

    • Flutter

      • Quick Start
      • APIs

        • 核心认证 API
        • 标准协议 API
        • 多因素认证 API
        • 扫码认证 API
        • 社会化登录 API
      • Private Deployment
    • iOS

    • React Native
  • Standard Web Application

  • Framework Integration

  • Others

  1. Development Integration
  2. /
  3. Mobile and Client Applications
  4. /
  5. Flutter
  6. /
  7. APIs

  8. /
  9. 多因素认证 API

¶ 多因素认证 API

Update time: 2025-07-23 07:34:21
Edit

¶ MFA 检测

检测手机号或者邮箱是否可以被用作 MFA

static Future<bool> mfaCheck(String? phone, String? email) async

参数

  • phone 被检测的手机号。可以为空
  • email 被检测的邮箱。可以为空

示例

bool r1 = await AuthClient.mfaCheck("188xxxx8888", null);
bool r2 = await AuthClient.mfaCheck(null, "abc@gmail.com");

¶ 短信验证

通过短信进行多因素认证

static Future<AuthResult> mfaVerifyByPhone(String phone, String code) async

参数

  • phone 手机号码
  • code 短信验证码

示例

AuthResult result = await AuthClient.mfaVerifyByPhone("188xxxx8888", "1234");

¶ 邮箱验证

通过邮件验证码进行多因素认证

static Future<AuthResult> mfaVerifyByEmail(String email, String code) async

参数

  • email 邮箱地址
  • code 邮件验证码

示例

AuthResult result = await AuthClient.mfaVerifyByEmail("1@gmail.com", "1234");

¶ TOTP 验证

通过一次性密码 TOTP (Time-based One Time Password) 进行多因素认证

static Future<AuthResult> mfaVerifyByTOTP(String code) async

参数

  • code TOTP code

示例

AuthResult result = await AuthClient.mfaVerifyByTOTP("1234");

¶ 恢复码验证

用户在绑定 TOTP 时会得到一个恢复码,用户需要安全保存该恢复码,在调用此 API 时,将其作为参数传入。

注意,恢复码验证成功后,会生成新的恢复码,旧的恢复码失效

static Future<AuthResult> mfaVerifyByRecoveryCode(String code) async

参数

  • code 恢复码

示例

AuthResult result = await AuthClient.mfaVerifyByRecoveryCode("1234");

Previous article: 标准协议 API Next article: 扫码认证 API
  • MFA 检测
  • 短信验证
  • 邮箱验证
  • TOTP 验证
  • 恢复码验证

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.