Forums / Developer / Automatic login based on the IP address

Automatic login based on the IP address

Author Message

Xavier Dutoit

Monday 04 September 2006 9:13:41 am

Hi,

I'd like to be able to automatically log in anyone with a specific IP address (or belonging to a specific ip range). For instance, everyone connecting with 192.168.*.* would be the user staff instead of being anonymous.

I suppose than writing a LoginHandler (as done for the cookieuser extension) would do it, wouldn't it ?

Has it be done already ? Would it be useful for some of you ?

X+

http://www.sydesy.com

Clemens T

Monday 04 September 2006 9:43:54 am

I'd say: don't do it. Because you could get reaal security problems when you try something like this.
Greets,
Clemens
ps: sorry for the brief comment, gtg.

Xavier Dutoit

Monday 04 September 2006 10:12:51 am

Hi,

Could you elaborate ?

I think I should inspire myself more on the sso instead of the cookieuser:
http://ez.no/community/forum/developer/setting_user_role_based_on_ip_address

http://www.sydesy.com

Clemens T

Monday 04 September 2006 3:51:01 pm

Sure Xavier!

For example: http://www.inetprivacy.com/a4proxy/fake-ip-address.htm

Good luck!
Clemens

Xavier Dutoit

Tuesday 05 September 2006 2:40:14 am

Hi,

The $_SERVER['REMOTE_HOST'] is going to contain the ip of the proxy, isn't it ?

That was the variable I intended to test for my purpose, and if one of the admin put the IP address of a public proxy, then that's not my problem.

In other word, if ou put the IP address of the gateway of a company and say that's the user "partner", every pc connected via that gateway is going to been see as a partner, and that's what I want.

Does it make sense ?
X+

http://www.sydesy.com

Clemens T

Tuesday 05 September 2006 4:22:28 am

Yes, that makes sense. And I think you should write your own LoginHandler, yes. For someone with your experience this shouldn't be too hard ;).

Grtz