Search Results :


How to setup Role based 2FA for Drupal

How to setup Role based 2FA for Drupal

Configure Two factor authentication for only a specific set of Roles. With the Role Based 2FA feature, you can enable 2FA for only a select few roles, and allow the rest to login using just their credentials. This can come in handy when you have to force authenticate the site admin accounts - who have complete access of the website - while logging in to prevent unwanted access in case of leaked credentials. And should you face any issues with the module or need any assistance in configuring the module, just drop us an email at, and we'll help you out.

Pre-requisite: Download and Installation 

  • Download the module:
    composer require 'drupal/miniorange_2fa'
  • Go to Extend menu on your Drupal admin console and enable the module by checking 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

Setup Role based 2FA

  • Register/Login with miniOrange.
  • Drupal 2FA registration
  • Navigate to Login Settings tab.
  • Under the 2FA MODULE SETTINGS make sure you have enabled the Enable Two-Factor module and Invoke Inline Registration to setup 2nd factor for users checkbox.
  • Drupal 2FA login settings
  • Under the same tab (Login Settings) Scroll down to the ROLE BASED 2FA section and enable the role based 2FA option then you can choose a specific roles for which you want to enable two factor authentication.
  • Click on the Save Settings button.
  • Drupal 2FA enable Rolebased 2fa
  • Now, open a new browser/private window and go to your Drupal site login page.
  • Login as the User, who has the particular Role assigned to him, for which you have enabled Role Based 2FA.
  • Drupal 2FA login
  • Enter the OTP and click on the Verify button.
  • Drupal 2FA enter OTP
  • You have successfully logged in to your Drupal site using the Role based 2FA feature.

Active Support & Other Solutions


If you have any doubts or queries, you can contact us at We will help you to configure the module. If you want, we can also schedule an online meeting to help you configure our Drupal module.

  24*7 Support
a Demo

We provide a 7 day full feature trial wherein you can fully test out all the features of the module. Please drop us an email at and ask for a trial.

  Request for Trail

Check out some of our most prominent and most popular success stories. These include Headless Solutions, Adaptive 2FA, SAML + User Provisioning and much more.

  Unique Solution

Check out our other modules for Secure Single Sign-On: Two Factor Authentication, Passwordless Authentication, Decouple / Headless Single Sign On, Provisioning, LDAP, Rest API and much more.

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