• Modx site - public access from a certain IP address#

  • TheGameAh Reply #1, 3 years, 3 months ago

    Reply
    Hey guys.

    Have a modx site running in which basically the entire site is protected. It's running on a DMZ inside our firewall.

    Everything is solid. However, I would like users who are inside the company to not have to login to see pages. I'm thinking the easiest way to do this is create a "guest" type web user, and somehow "auto logon" using that guest user if the machine IP address is inside our internal network.

    Any thoughts on how to pull this off?


  • hendo Reply #2, 3 years, 2 months ago

    Reply
    Hi there,

    I cannot help you with this but am after something similar myself. I am trawling the forum and will post back here if I find anything. Let me know if you work something out.

    Hendo


  • Everett Reply #3, 6 months, 4 weeks ago

    Reply
    That's a really good feature idea.

    It might be easiest to modify your .htaccess file to help do this... you could test the IP address (or the range), and then redirect somewhere. Maybe you could set up different contexts: one for public access, and one for internal access.

    Or... you could do use a plugin that evaluates the IP address and then perform the auto-login based on that IP address. But you have to be careful about this: IP addresses can be easily spoofed, so it'd be relatively easy for someone to spoof the IP address and thus trigger the "auto-login". Depending on how the sessions are created, you may end up validating the bogus request (the one that spoofed the IP address), and then subsequent requests from the disallowed IP address might gain unauthorized access. Definitely worth testing this for security holes.