Trusted IPs

The Drupal Two Factor Authentication module - TFA allows you to mark certain locations/computer networks as trusted and provides a hassle-free login experience by skipping 2FA. This setup guide will walk you through the steps to configure the trusted IP addresses feature of the Two Factor Authentication - TFA / Passwordless Login module. This module is compatible with Drupal 7, Drupal 8, Drupal 9, Drupal 10, and Drupal 11.

Prerequisites

  • The module is activated on your Drupal site. (Follow Installation steps)
  • The following checkboxes are enabled in the General 2FA Settings section under the 2FA Policy for End Users tab of the module: /admin/config/people/miniorange_2fa/login_settings
    • Activate Two-Factor Authentication
    • Enforce 2FA to end users

Setup Trusted IPs

  • Navigate to the 2FA Policy for End Users tab.
    Path: /admin/config/people/miniorange_2fa/login_settings
  • Scroll down to the 2FA Restrictions section and click on the IP Based Restriction tab.
  • Enable the Enable Trusted IP Based 2FA checkbox.
  • In the text field, enter the IPs you want to exclude from 2FA. (You can Whitelist IP ranges as well)
  • Click on the Save Settings button.

User Experience

  • Open a new browser or private window, and navigate to your Drupal site’s login page.
  • Login with your Drupal credentials.
  • If the IP address matches one of the Trusted IP addresses, then 2FA won't be invoked, and the user gets logged in directly.
  • Alternatively, if the IP address does not match one of the trusted IPs, the user will be prompted to complete an additional verification step, i.e., 2FA will be invoked.