I am trying to create an authentication system that works within the limitations of my organisation's network infrastructure both when inside the local network and outside.

When inside the local network I want people to be able to access this ASP.NET Web Forms application without having to log in using their Windows login.

Externally I want people to have to log in through a custom login form.

The reason is that Windows authentication does not work outside of our local network, due to the local infrastructure.

So, I created a password protected folder by disabling anonymous authentication just for that folder, and then on every page request I check if the user is flagged as being logged in (details on how I do this are unimportant) and if they aren't I redirect to a page that does an AJAX request to a web service located inside the password protected folder to see if they are logged in on the local network. If they aren't then it redirects to the custom login form page.

Now this all sounded like a good idea at the time but in practice it does something undesirable... When an external user attempts to access and the AJAX request is made, I get a browser username and password prompt which has to be cancelled to continue.

I appreciate that this type of authentication is part of HTTP and probably can't be bypassed, even using AJAX, but any ideas how I can get this working without the username/password prompt or an alternate way of checking whether local network or external access?

I know I could check the IP address but I understand this can be faked (although that would only cause an issue to the user attempting to do this).

I also know I could have a different entry point for internal or external but I wanted to avoid this.

Related posts

Recent Viewed