Menu Close
    Searching for an experienced eCommerce & Marketplace Development Company ?

    Two Factor Authentication for Magento 2

    Two Factor Authentication for Magento 2 functionality is used to provide the extra security feature to the account. This is verified in two cases i.e creation of a new account and login into the account of existing customers. It is one the most reliable process of security of account purposes.

    Features

    • At the time of registration, Auth Code will be sent to the mobile number entered. However, it will be verified after the account will be created.
    • Admin can enable/disable the TwoFactorAuth module from the admin configuration.
    • Admin can enable/disable TwoFactorAuth verification of the customers at the time of registration
    • Customers have to verify to access the account.
    • Verification code expiration time period can be changed by the admin.

    Install Extension from Webkul Store

    #1 Download Module

    Firstly, you need to log in to Webkul Store, go to My Account>My Purchased Products section, verify and then download and extract the contents of this zip folder on the system.

    #2 Upload Folder

    Once the module zip is extracted, follow path src>app and then copy the app folder into the Magento 2 root directory on the server as shown below:

    installation

    #3 Run Commands

    After uploading the module folder, you need to run the following commands in the Magento 2 root directory:

     After installation, the module First command should composer require twilio/sdk

    • php bin/magento setup:upgrade
    • php bin/magento setup:di:compile
    • php bin/magento setup:static-content:deploy
    • php bin/magento indexer:reindex
    • php bin/magento cache:flush
    After running the commands, you have to flush the cache from the Magento admin panel. By navigating through System > Cache management as shown below.
    Magento 2 Cache

    Install Extension from Magento Marketplace

    If you have purchased this extension from the Magento Marketplace then please follow the below process or visit this link.

    #1 Get Access Keys

    You need to get access keys, navigate to My Profile in Magento Marketplace, then choose Access Keys in the My Products section.

    my-profile

    Go to Magento 2 and then you need to copy both the Access Keys – Public Key and Private Key. These access keys will be needed in the next steps for authentication.

    copy-keys

    If access keys are not created earlier, click Create A New Access Key, enter any name and click OK.

    create-key-name

    #2 Update composer.json File

    To know the component name and version number, go to your Magento Marketplace account section, My Profile>My Purchases, then find this extension to view the details. Please note – Below is an example image, every extension will have its unique component name and version.

    know-component-name-version

    After that, navigate to your Magento project directory and update your composer.json file in the following format.

    composer require <component-name>:<version>

    For example, to install version 5.0.0 of this extension you need to run the following command:

    composer require webkul/2fa:5.0.0

    #3 Enter Access Keys

    Now you will need to enter the Access Keys that you obtained as explained in the first step #1 Get Access Keys. Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.

    #4 Run Command

    You need to run the following commands:

    • php bin/magento setup:upgrade
    • php bin/magento setup:di:compile
    • php bin/magento setup:static-content:deploy
    • php bin/magento indexer:reindex
    • php bin/magento cache:flush

    Multi-Lingual Support

    For multilingual support, the admin will navigate through Store > Configuration > General > Locale Options. Now select the locale as English (the language into which the admin wants to translate his store content).

    Magento 2 language

    Admin Configuration

    Once the module of Two Factor Authentication for Magento 2 is installed completely. The admin will now manage the feature from the backend by navigating to Stores > Configuration > TwoFactorAuth.

    The admin will set the Enable to Yes to make the module active for the store. Else, the admin will set  No to disable the feature for the store.

    Magento 2 TwoFactorAuth

    Admin Enable /Disable 

    In configuration settings, the admin can enable and disable the twofactAuth.

    Admin-settings

    • Enable Module on Frontend:- Admin can enable and disable the module by YES/No
    • Need Auth Validation On Customer Registration:- To register new customer validation needed or not YES/No.
    • Auth Code Expiry:- OTP duration is between 60 to 300 sec.

    Twilio Auth

    “Twilio” is a communications platform for sending and receiving text messages using its web service APIs.

    The admin can signup for the Twilio services and register to the Twilio. To register, the admin can visit Twilio then click on the signup button. 

    Twilio sign up

    Now, from the Twilio account, the admin can access the information required in the admin dashboard. 

    Settings

    New Customer:-Account Registration and verification

    At time new account creation by customer. OTP will be sent to the customer’s mobile number. Now customer to go through the two-step verification. As per the given below image.

    TwoFactor-Auth-V

    Enter the OTP  sent on the registered mobile number. After the verification Account is verified successfully of a new customer. It appears like the given below image.

    Account-verification

    Existing Customer

    TwoFactAuth is applicable for the existing customer. Any time an existing customer does the login. He receives the OTP. After entering the OTP they can use their account after verification.

    Existing-Customer-otp

    Thus, the customer receives the OTP (SMS) on the mobile, as shown in the image below.

    OTP (One Time Password)_mobile-otp

     

    That’s all for the Two Factor Authentication for Magento 2 . Still, if you face any issue feel free to add a ticket. Let us know your views to make the module better https://webkul.uvdesk.com/

    Current Product Version - 5.0.0

    Supported Framework Version - 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x

    Blog Version - 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x
    • Version 2.4.x.
    • Version 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x
    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Table of Content

    Hide Index