Authing DocsDocuments
Concept
workflow
Guides
Development Integration
Application integration
Concept
workflow
Guides
Development Integration
Application integration
Old Version
Guides
  • Quick start

  • Authenticate the user

    • Use account password authentication
    • Use SMS verification code authentication
    • Use social login authentication
    • Use scan code login authentication

    • Certify in Mini Program
    • Implement single sign-on (SSO)
    • Single sign-on on the mobile terminal
    • Multi-factor authentication (MFA)

    • Extend the authentication process

    • Personalize the guard
  • Authority management for users

  • Authorization

  • Manage user accounts

  • Manage User Directory

  • Management Application

  • Become a source of federal authentication identity

  • Connect to an external identity provider (IdP)

  • Open up WeChat ecology
  • Migrate users to Authing

  • Management organization

  • Expandable capabilities

  • Audit Log

  • Configure security information

  • Configure user pool information

  • Deployment plan

  • Frequently Asked Questions FAQs

  1. Guides
  2. /
  3. Authenticate the user
  4. /
  5. Use SMS verification code authentication

¶ Use SMS Verification Code to Authenticate

Update Time: 2025-05-14 08:32:28
Edit

Developers can use the standard login components and API & SDK provided by Authing to quickly implement a mobile phone number-based user system. You can also configure the white list of mobile phone numbers in Console > user management > registration white list, so that only mobile phone numbers in the white list can be registered and logged in. The verification code SMS will use Authing's unified SMS template by default. If you want to customize the SMS template, you can configure the custom SMS template in console > settings > Message Service.

¶ Use hosted login page

¶ Login

Mobile phone number password login mode, it will automatically create an account if user does not exist.

The default login method of the application is username and password login. You can modify in the application configuration:

¶ Registration

The default registration method of the application is password login. You can modify in the application configuration:

¶ Use embedded login component

The embedded login component and the online hosting login page are basically the same in style and interaction. The difference is that the online hosting login page is fully managed by Authing, which is completely independent from your application, while the embedded login component can be embedded in your application. For detailed usage, please see: Use the embedded login component to authenticate.

¶ Use API & SDK

¶ Send SMS verification code

Language
Java
Loading...

Use 用户池 ID(UserPool ID) 和应用 ID(AppID) 初始化 Java SDK 的 AuthenticationClient:

import cn.authing.core.auth.AuthenticationClient;
// Use  AppId 和 appHost 进行初始化
AuthenticationClient authentication = new AuthenticationClient(APP_ID, APP_HOST);

authenticationClient.setSecret("AUTHING_APP_SECRET");

Use sendSmsCode 方法:

String phone = "phone number";
authenticationClient.sendSmsCode(phone).execute();

¶ Login

Language
Java
Loading...

Use 用户池 ID(UserPool ID) 和应用 ID(AppID) 初始化 Java SDK 的 AuthenticationClient:

import cn.authing.core.auth.AuthenticationClient;
// Use  AppId 和 appHost 进行初始化
AuthenticationClient authentication = new AuthenticationClient(APP_ID, APP_HOST);

authenticationClient.setSecret("AUTHING_APP_SECRET");

首先调用发送短信验证码接口发送短信验证码,然后 Use loginByPhoneCode 方法:

String phone = "phone number";
String code = "1234";
User user = authenticationClient.loginByPhoneCode(new LoginByPhoneCodeInput(phone, code)).execute();

¶ Registration

Language
Java
Loading...

Use 用户池 ID(UserPool ID) 和应用 ID(AppID) 初始化 Java SDK 的 AuthenticationClient:

import cn.authing.core.auth.AuthenticationClient;
// Use  AppId 和 appHost 进行初始化
AuthenticationClient authentication = new AuthenticationClient(APP_ID, APP_HOST);

authenticationClient.setSecret("AUTHING_APP_SECRET");

首先调用发送短信验证码接口发送短信验证码,然后 Use registerByPhoneCode 方法:

String phone = "phone number";
String code = "1234";
String pasword = "123456"
User user = authenticationClient.registerByPhoneCode(new RegisterByPhoneCodeInput(phone, code).withPassword(password)).execute();
Prev: Use account password authentication Next: Use social login authentication
  • Use hosted login page
  • Use embedded login component
  • Use API & SDK

User identity management

Integrated third-party login
Mobile phone number flash check (opens new window)
Universal login form component
Custom authentication process

Enterprise internal management

Single Sign On
Multi-factor Authentication
Authority Management

Developers

Development Document
Framework Integration
Blog (opens new window)
GitHub (opens new window)
Community User Center (opens new window)

Company

400 888 2106
sales@authing.cn
16 / F, Block B, NORTH STAR CENTURY CENTER, Beijing(Total)
room 406, 4th floor, zone B, building 1, No. 200, Tianfu Fifth Street, Chengdu(branch)

Beijing ICP No.19051205-1

© Beijing Steamory Technology Co.