Search Results :


Setup Role Based 2FA for Drupal

Setup Role Based 2FA for Drupal

Role Based 2FA provides you with the ability to add a layer of security with 2FA/TFA on selected roles like admin while allowing other users to log in to the site only with basic authentication with a Drupal username and Password. This document will walk you through the steps to configure 2FA/MFA for specific Drupal roles with Drupal 2FA module.The Drupal Two Factor Authentication - 2FA / Passwordless Login is available for Drupal 7, Drupal 8, Drupal 9 and Drupal 10.

Installation Steps:

  • Download the module:
    composer require 'drupal/miniorange_2fa'
  • Go to Extend menu on your Drupal admin console and enable the module by enabling the checkbox and click on Install button.
  • Configure the module at:
  • Install the module:
    drush en miniorange_2fa
  • Clear the cache:
     drush cr
  • Configure the module at:
  • Navigate to Extend menu on your Drupal admin console and click on Install new module.
  • Install the Drupal Two Factor Authentication / Passwordless login module either by downloading the zip or from the URL of the package (tar/zip).
  • Click on Enable newly added modules.
  • Enable this module by checking the checkbox and click on Install button.
  • Configure the module at


  • The following checkboxes are enabled under Login Settings tab of the module:
    • Enable Two-Factor module
    • Invoke Inline Registration to setup 2nd factor for users

Setup Role Based 2FA

  • Register/Login with miniOrange.
  • Navigate to Login Settings tab.
  • Scroll down to the Role based 2FA section and enable the role based 2FA checkbox then you can choose specific roles for which you want to enable two factor authentication.
  • Drupal 2FA enable Rolebased 2fa
  • Click on the Save Settings button.

User Experience:

  1. Open a new browser/private window and navigate to login page of Drupal site.
  2. Log in with your Drupal credentials.
  3. If the user has configured Drupal role, then 2FA will be invoked.
  4. User will be logged in after the second fector authentication.

Additional Features:

Explore the advanced features offered by the module with full-featured trial. You can initiate the trial request using Request 7-day trial button under Register/Login tab of the module or reach out to us at for one-on-one assistance from Drupal expert.

 Case Studies
miniOrange has successfully catered to the use cases of 400+ trusted customers with its highly flexible/customizable Drupal solutions. Feel free to check out some of our unique case studies using this link.
 Other Solutions
Feel free to explore other Drupal solutions that we offer here. The popular solutions used by our trusted customers include SSO, User Provisioning, Website Security. 
  24*7 Active Support
The Drupal developers at miniOrange offer quick and active support for your queries. We can assist you from choosing the best solution for your use case to deploying and maintaining the solution.
Hello there!

Need Help? We are right here!

Contact miniOrange Support

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to