sadlermd
asked on
How to correctly recognize intranet users from internet users (IIS 7)...
Using: C#, .NetFramework 3.5 and 4, IIS 7
I am trying to determine if the user who is navigating to our site is on our intranet.
Here is what I have, and it works when I test it on my development pc - just not 100% sure this is production ready:
string userTryingToLoginToMyWebAp p = Request.UserHostAddress;
string serverHostingMyWebApp = Request.ServerVariables["L OCAL_ADDR" ];
if (userTryingToLoginToMyWebA pp == serverHostingMyWebApp) { // "intranet user..."; }
Thanks in advance,
Rick
I am trying to determine if the user who is navigating to our site is on our intranet.
Here is what I have, and it works when I test it on my development pc - just not 100% sure this is production ready:
string userTryingToLoginToMyWebAp
string serverHostingMyWebApp = Request.ServerVariables["L
if (userTryingToLoginToMyWebA
Thanks in advance,
Rick
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works...
10.0.0.0 … 10.255.255.255
172.16.0.0 … 172.31.255.255
192.168.0.0 ....
So, you will have to put those into consideration.
You have may have to do something like:
If Request.ServerVariables("R
OR
Request.ServerVariables("R
OR
Request.ServerVariables("R
...