Author Topic: How to disable a plugin 2FA for a specific IP address  (Read 1681 times)

Offline mdenizli

  • Newbie
  • *
  • Posts: 2
How to disable a plugin 2FA for a specific IP address
« on: February 13, 2024, 06:18:29 AM »
If a connection is made with an IP other than a static IP, I want two factors to be active. How can I do that?

Local IP block: 172.16.x.x
static ip address: 31.223.10.104

config.inc.php open the file

// whitelist, CIDR format available
// NOTE: we need to use .0 IP to define LAN because the class CIDR have a issue about that (we can't use 129.168.1.2/24, for example)
$rcmail_config['whitelist'] = array('172.16.0.0/16', '31.223.10.104');

I edit it like this but it doesn't work. Where am I making a mistake?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: How to disable a plugin 2FA for a specific IP address
« Reply #1 on: February 13, 2024, 09:02:10 AM »
I haven't used the plugin so I can't say for sure what the configuration needs to be, but one think I noticed is that the config.inc.php no longer uses the "$rcmail_config" variable for the config it now uses the "$config" variable so try changing that.

Offline mdenizli

  • Newbie
  • *
  • Posts: 2
Re: How to disable a plugin 2FA for a specific IP address
« Reply #2 on: February 14, 2024, 01:21:32 AM »
But here's the thing. When 127.0.0.1 is added, two factors are disabled for all IPs. So doesn't it show that the system is working? But when we add the local IP and static IP we want, it doesn't work.