Skip to main content

Add SMS OTP login

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

An SMS one-time password (OTP) delivers a short-lived code to the user’s registered mobile number. This works as a passwordless authentication mechanism, allowing users to log in without a password by entering the OTP received via SMS.

Follow the instructions given below to implement passwordless login using SMS OTP in WSO2 Identity Platform.

Prerequisites​

  • Configure your preferred SMS provider in WSO2 Identity Platform. For detailed instructions, see Configure SMS providers.

    note

    You cannot use an administrator account to log in to an application.

Configure SMS OTP​

To update the default SMS OTP settings:

  1. On the WSO2 Identity Platform Console, go to Connections and select SMS OTP.
  2. Update the following parameters in the Settings tab: Setup SMS OTP in WSO2 Identity Platform
    FieldDescription
    SMS OTP expiry timeSpecifies the OTP expiry time. The generated OTP won't be valid after this time.
    Use only numeric characters for OTPSpecifies whether to use only numeric characters in the OTP. If this is selected, the generated OTP contains only digits (0-9). If this option is not selected, the OTP will contain alphanumeric characters.
    SMS OTP lengthSpecifies the number of characters allowed in the OTP.
    Allowed OTP resend attempt countSpecifies the number of allowed OTP resend attempts.
  3. Once you update the SMS OTP settings, click Update.

Enable SMS OTP login for your app​

Follow the steps given below to add SMS OTP login to the login flow of your application.

  1. On the WSO2 Identity Platform Console, go to Applications.

  2. Select the application to which you wish to add SMS OTP login.

  1. Go to the Login Flow tab of the application and add SMS OTP login as follows:

    To add passwordless login with SMS OTP using the Visual Editor:

    1. Switch to the Visual Editor tab and go to Predefined Flows > Basic Flows > Add Passwordless login.

    2. Select SMS OTP.

    3. Click Confirm to add passwordless login with SMS OTP to the sign-in flow.

      Configuring SMS OTP login in WSO2 Identity Platform using the Visual Editor

  1. Click Update to save your changes.

Try it out​

Follow these steps to test the SMS OTP login:

  1. Visit the application URL.

  2. Click Login to bring up the WSO2 Identity Platform login page.

  3. On the login page, enter your username and click Continue.

    Sign In with SMS OTP in WSO2 Identity Platform

    This action redirects you to the SMS OTP page.

    SMS OTP submit page
  4. Check your phone for the SMS containing the one-time password (OTP).

  5. Enter the received OTP on the SMS OTP page and click Continue.

Was this page helpful?