Developer forum

Forum » Development » Login via IP adress or Windows notifications

Login via IP adress or Windows notifications

Morten Sigh
Reply

We are about to make an intranet area, where we of course have some users with access.

However, our customer requests that everyone who accesses the intranet from the companys IP address have access without login. Just based on the IP they are entering from.

Alternative the dw system could get the login from Windows notificaions.

Is it possible? Has anyone tried something similar?


Replies

 
Anders Ebdrup
Anders Ebdrup
Reply

Hi Morten,

 

Yes, we have done that - please take a look at this thread: http://doc.dynamicweb.com/forum/development/intranet-ip?PID=1605

 

Best regads,

Anders

 
Dmitrij Jazel
Reply

Hi Morten,

You know if someone descovers your IP, than they will have full access to your solution?

Be sure to consider security seriously.

 

But if you stil must implement this (customer insists) here is my suggestion on how to solve this:

1) First you need a place in API where your logic is going to run and where you are going to identify for IP adress.

I would suggest doing it in page load event

[Subscribe(Dynamicweb.Notifications.Standard.Page.Loaded)]
public class PageLoaded : NotificationSubscriber
{
    public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
    {
        if (args == null)
            return;
    
        //TODO: Step 1) Check your IP        
        //TODO: Step 2) Authenticate user via API
    }
}

2) Check your IP

var IP = HttpContext.Current.Request.Headers.Get("HTTP_X_FORWARDED_FOR")

3) If IP is right - than you can authenticate user by using API

http://doc.dynamicweb.com/forum?M=BasicForum&PID=1605&ThreadID=44540

 

Please be sure to consider security measures.

 

/Dmitrij

 

You must be logged in to post in the forum