Menu

WhatsApp

RootAuth supports passwordless sign-in and sign-up with WhatsApp. After users select WhatsApp sign-in, they enter a phone number and receive an OTP in WhatsApp. Once the code is verified, RootAuth automatically signs them in or creates an account.

This feature uses the WhatsApp Business API (Cloud API) to send verification-code template messages. It does not use the OAuth authorization code flow.

Path: Sign in to the RootAuth Console → open the target application → select Configuration in the top navigation → Application Management - Authentication Configuration → Providers.

 

1. Before You Start

Before configuring WhatsApp sign-in, prepare the following:

  • Create a WhatsApp Business account in Meta for Developers and obtain the Phone Number ID.
  • Create an OTP verification-code message template in Meta, have it approved, and obtain the template name.
  • Generate a permanent Meta Access Token with the whatsapp_business_messaging permission.
  • Obtain the WhatsApp Business Account ID, which is used to retrieve the verification-code templates available to the business account.

 

2. Enable WhatsApp in the RootAuth Console

Find WhatsApp in the Providers list and select Enable. Initially, the provider displays only the Enable button.

2.1 Configure Credentials

Selecting Enable or Manage opens the WhatsApp configuration dialog. This provider supports only Custom credentials and cannot be switched to another credential mode.

Turn on the switch at the top, then complete the following configuration:

Setting Description
Access Token Required. The permanent Meta Access Token. The input supports showing or hiding the value.
WhatsApp Business Account ID Required. Used to retrieve verification-code templates available to this WhatsApp Business account.
Phone Number ID Required. The WhatsApp Business phone number ID, for example 123456789012345.
Verification-code template name Required dropdown. Enter the Access Token and Business Account ID first, then select a template returned by the backend. Only authentication templates whose message body type is BODY can be selected.

The verification-code template name cannot be selected until you enter the Access Token and Business Account ID. The backend may return multiple templates, but templates that are not authentication templates cannot be selected.

 

2.2 Calling Codes and Sign-In Mode

WhatsApp sign-in calling codes do not depend on the phone-number sign-in settings in Login Control:

  • Hosted integration: Uses the default calling-code list provided by RootAuth.
  • API integration: The application builds its own calling-code selector and submits the calling code with the phone number.

The sign-in mode is fixed as Available for sign-in and sign-up and cannot be turned off.

 

2.3 Account Linking

Account linking is off by default. When enabled, RootAuth automatically uses Automatic linking and does not show a confirmation dialog:

  • If the full phone number matches an existing account, RootAuth links the WhatsApp identity and signs the user in to that account.
  • If no existing account matches, RootAuth creates a new account and links the WhatsApp phone number.

When account linking is off, WhatsApp phone numbers and standard system phone numbers are managed separately. Even if the numbers are the same, accounts registered through different methods remain independent and are not linked automatically.

2.4 Save and Disable

After all required fields pass validation, select Save. When enabled, the provider card displays the Enabled and Custom credentials labels, and the button changes to Manage.

When the top switch is turned off, the WhatsApp entry no longer appears on end-user sign-in pages. Saved credentials are retained for later reuse. While the switch is off, the configuration form and save action are unavailable.

 

3. Integration Methods

WhatsApp sign-in supports two integration methods:

Method Description
Hosted integration Use RootAuth-hosted sign-in and sign-up pages. When WhatsApp is enabled, the third-party sign-in area displays the WhatsApp entry and includes calling-code selection, phone-number input, code sending, and verification.
API integration Build the frontend form, calling-code selector, and user interaction in your application, then use the RootAuth API to send and verify codes and complete sign-in.

For detailed integration instructions, see the Developer Integration Guide.

 

4. How Users Sign In with WhatsApp

After WhatsApp is enabled, the sign-in and sign-up pages display a WhatsApp icon. Users select it, choose a calling code, enter a phone number, and complete code delivery and verification.

4.1 Phone Number Format and Calling-Code List

RootAuth uses the full phone number as the WhatsApp identity, in the format {country_code} {phone_number}, for example +86 13800138000.

RootAuth-hosted pages support the following country and region calling codes:

Code Country or region Code Country or region Code Country or region
+86 China mainland +852 Hong Kong SAR, China +853 Macao SAR, China
+886 Taiwan, China +81 Japan +82 South Korea
+65 Singapore +60 Malaysia +66 Thailand
+62 Indonesia +63 Philippines +84 Vietnam
+91 India +92 Pakistan +880 Bangladesh
+94 Sri Lanka +977 Nepal +95 Myanmar
+855 Cambodia +856 Laos +976 Mongolia
+673 Brunei +971 United Arab Emirates +966 Saudi Arabia
+90 Turkey +972 Israel +974 Qatar
+965 Kuwait +973 Bahrain +968 Oman
+962 Jordan +961 Lebanon +964 Iraq
+98 Iran +44 United Kingdom +49 Germany
+33 France +39 Italy +34 Spain
+31 Netherlands +32 Belgium +41 Switzerland
+43 Austria +46 Sweden +47 Norway
+45 Denmark +358 Finland +351 Portugal
+353 Ireland +48 Poland +420 Czechia
+36 Hungary +30 Greece +7 Russia
+380 Ukraine +40 Romania +359 Bulgaria
+385 Croatia +421 Slovakia +386 Slovenia
+372 Estonia +371 Latvia +370 Lithuania
+352 Luxembourg +354 Iceland +375 Belarus
+381 Serbia +1 United States and Canada +55 Brazil
+52 Mexico +54 Argentina +56 Chile
+57 Colombia +51 Peru +58 Venezuela
+593 Ecuador +591 Bolivia +598 Uruguay
+595 Paraguay +61 Australia +64 New Zealand
+27 South Africa +234 Nigeria +20 Egypt
+254 Kenya +212 Morocco +233 Ghana
+255 Tanzania +256 Uganda +251 Ethiopia
+213 Algeria +216 Tunisia +244 Angola
+260 Zambia +263 Zimbabwe    

 

4.2 Send and Verify the Code

  1. The user selects a calling code and enters a phone number.
  2. Before requesting a code, the user must complete human verification.
  3. RootAuth sends a verification-code template message to the phone number through the WhatsApp Business API.
  4. The user views the code in the WhatsApp app and enters it on the sign-in page.
  5. After successful verification, RootAuth automatically completes sign-in or sign-up.

 

5. Account Linking and Matching

RootAuth uses the full phone number, including calling code, as the unique identifier for the WhatsApp provider, for example +86 13800138000.

  • Account linking enabled: When the full phone number matches an existing account, RootAuth signs the user in and links the WhatsApp identity. If it does not match, RootAuth creates a new account and links it.
  • Account linking disabled: WhatsApp sign-in and standard phone-number sign-in or sign-up are separate entry points. Even if the phone numbers are the same, they are not automatically linked to the same account.

WhatsApp phone numbers are stored separately as whatsapp_phone, with the calling code and phone number stored independently. This field is separate from the application's standard phone field.

 

6. Link or Unlink a WhatsApp Account

Applications can use the API to let signed-in users link or unlink WhatsApp:

  • Link WhatsApp: A signed-in user submits a phone number and completes WhatsApp OTP verification. RootAuth then links the full phone number to the current account.
  • Unlink WhatsApp: When a signed-in user calls the unlink API, RootAuth removes the WhatsApp phone-number link from the current account.

The RootAuth Console does not provide an administrator interface for manually linking or unlinking WhatsApp. Applications should implement user-initiated linking and unlinking through the API.

 

7. View a User's WhatsApp Authentication Method

After a user signs in, signs up, or links WhatsApp, open the user in User Management and view the WhatsApp record in Authentication methods.

Field Description
Authentication method WhatsApp, displayed with the WhatsApp icon.
Identifier Displays the WhatsApp phone number with its calling code.
Last used The most recent time the user signed in with WhatsApp.

After an application links WhatsApp through the API, this authentication method appears. After it is unlinked, the record is removed from the user details page.

 

8. Audit Logs

RootAuth records the following WhatsApp events in Audit Logs → User Behavior Logs:

Event type Description
WhatsApp sign-up A user creates a new account through WhatsApp OTP.
WhatsApp sign-in A user signs in to an existing account through WhatsApp OTP.
Link WhatsApp A signed-in user links WhatsApp through the application.
Unlink WhatsApp A signed-in user unlinks WhatsApp through the application.

 

9. Disable WhatsApp Sign-In

To disable WhatsApp sign-in, open the WhatsApp management dialog and turn off the switch at the top.

After WhatsApp sign-in is disabled:

  • The WhatsApp entry no longer appears on sign-in and sign-up pages.
  • Saved WhatsApp Business API credentials are retained.
  • Existing users' WhatsApp links are not removed.
  • You can reuse the original configuration if you enable WhatsApp again later.
Previous
VKontakte
Next
Security Settings
Last modified: 2026-07-17Powered by