# Magento 2 OTP Login

### <span style="color: #3b82f6;">Installation and User Guide for Magento 2 OTP Login Extension</span>

**Table of Contents**

1. [*Installation* ](#bkmrk-installation)
    - *Installation via app/code*
    - *Installation via Composer*
2. [*Configuration Settings for OTP Login*](#bkmrk-configuration-settin)
    - [*General Settings* ](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4)
    - [*OTP Configuration*](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4-1)
    - [*API Configuration*](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4-2)
    - [*Emails* ](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4-3)
    - [*Messages*](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4-4)
3. [*Sign in using OTP*](#bkmrk-sign-in-using-otp)
    - [*Login with Mobile*](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4-5)
    - [*Login with Email*](https://docs.scommerce-mage.com/magento-2-otp-login.md#bookmark4-6)
4. *[Registration using OTP](#bkmrk-registration-using-o)*
5. *[Update Mobile Number](#bkmrk-update-mobile-number)*

### <span style="color: #3b82f6;">Installation</span> [](#bkmrk-)

- <span style="color: #f97316;">**Installation via app/code:**</span> Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.
    
     ```php
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    ```
- <span style="color: #f97316;">**Installation via Composer:**</span> Please follow the guide provided in the below link to complete the installation via composer.

<p class="callout success">[https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer](https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer)</p>

### <span style="color: #3b82f6;">Configuration Settings for OTP Login</span> [](#bkmrk--1)

Go to **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; OTP Login**

#### <span style="color: #f97316;">General Settings</span> [](#bkmrk--17)

- **Enabled -** Select "Yes" or "No" to enable or disable the module.
- **License Key -** Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. Please go to *Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Core* and click on "Verify" to verify the license key.
- **Enable Login with Mobile** - Select "Yes" or "No". If set to "Yes" then users will be able to login to the store using their mobile number.

[![image (37).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/JLlimage-37.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/JLlimage-37.png)

#### <span style="color: #f97316;">OTP Configuration</span> [](#bkmrk--17)

- **Allowed Countries-** Select the countries allowed to be used for sending via SMS.
- **OTP Type -** You can select the OTP type that sent via sms from Number, Alphabets, and Alphanumeric.
- **OTP Length** - Enter the length of the OTP sent.
- **Expire Time-** Add the time after which the OTP is expired and can't be used after this duration.
- **Time Between Resend (sec)-** Enter the time in seconds after which users will be able to resend the otp.
- **Retry Count-** Enter the number of retries allowed to resend otp before the user is locked out.
- **Lock Time (minutes)-** Add the lock time on multiple otp failures
- **Channel on Register-** Select the countries allowed to be used for sending via SMS.

[![image (8).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/RG1image-8.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/RG1image-8.png)

#### <span style="color: #f97316;">API Configuration</span> [](#bkmrk--17)

This section is to configure TWILIO as the SMS provider used for sending OTPs. Please visit [https://www.twilio.com/en-us](https://www.twilio.com/en-us) to create an account and extract the information to be added below:-

- **Sender ID-** Add the sender ID from Twilio.
- **Authorization Key -** Add the authorization key from Twilio
- **Mobile Number**- Add the mobile number from Twilio without the "+" sign

[![image (9).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/oG1image-9.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/oG1image-9.png)

#### <span style="color: #f97316;">Emails</span> [](#bkmrk--17)

This section is to configure the Sender Email and the Email template used to send OTPs via Email:-

- **Success Email Sender-** Select the Email to be used for sending successful login emails.
- **Otp Email Template -** Select the Email template to be used for OTP emails.

[![image (10).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/sQJimage-10.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/sQJimage-10.png)

#### <span style="color: #f97316;">Messages</span> [](#bkmrk--17)

This section is to configure the Sender Email and the Email template used to send OTPs via Email:-

- **Register Channel Message-** Enter the message to be displayed on the registeration page for the users.

[![image (11).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/1nkimage-11.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/1nkimage-11.png)

### <span style="color: #3b82f6;">Sign In Using OTP</span> [](#bkmrk--23)

#### <span style="color: #f97316;">Login with Mobile</span> [](#bkmrk--17)

Go to the frontend and click on Sign In, you will it opens a popup to signin with Mobile. Add your Mobile number and click on Send OTP. Make sure Sign in with Mobile is enabled in the configuration only then you will be able to sign in using Mobile Number.

[![image (5).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/bL9image-5.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/bL9image-5.png)

Enter the OTP to sign in

[![image (12).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/eadimage-12.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/eadimage-12.png)

If the OTP is expired click on resend to resend the otp.

[![image (13).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/uFbimage-13.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/uFbimage-13.png)

#### <span style="color: #f97316;">Login with Email</span> [](#bkmrk--17)

Go to the frontend and click on Sign In, you will it opens a popup, select Signin with Email.

[![image (14).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/X21image-14.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/X21image-14.png)

Add credentials and proceed an OTP will be sent to your email, add to login to the store.

[![image (15).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/yi0image-15.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/yi0image-15.png)

### <span style="color: #3b82f6;">Registration using OTP</span> [](#bkmrk--23)

Go to the store and click on "Create an account", the registration will popup, add your details alongwith your phone number.

[![image (6).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/BUrimage-6.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/BUrimage-6.png)

Finally click on Create Account and an OTP will be sent to your mobile number use it to register on the store.

[![image (7).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/Fsaimage-7.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/Fsaimage-7.png)

### <span style="color: #3b82f6;">Update Mobile Number</span> [](#bkmrk--23)

Users can update their Phone Number with the Account by signing in to the store and then going to the "My Account" section. From the left menu click on "OTP Settings". Add your new number and password to update the mobile number.

[![image (16).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/Rlkimage-16.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/Rlkimage-16.png)

If you have a question related to this extension please check out our [**FAQ Section**](https://www.scommerce-mage.com/magento-2-otp-login.html#customfaq) first. If you can't find the answer you are looking for then please contact [**support@scommerce-mage.com**](mailto:core@scommerce-mage.com)**.**