I am hosting several IFrames on a 3rd party web site. The 3rd party site is the middle man to allow user access to a web site that is primarily for internal use by another company.
What I would like to do is verify the user's IP Address against a range of valid IP's for the 3rd party (middle man) web site. If it falls in the range allow the user to access the IFrame, if not - ACCESS DENIED!
Anyways, there are a ton of examples online to get the Request.UserHostAddress, but this brings back my IP Address.
My question is: how do I get the user's IP Address whom is accessing the IFrame to assure the request is coming from the 3rd party site?
So far I have tried ServerVariables and UserHostAddress. They both return ::1. I am running the site that hosts the IFrames locally and accessing those through the 3rd party site which is hosted on a server.
UPDATE
I have finally gotten around to updating everyone. Trying to do this by code is not a viable solution. But, I believe there is a solution for this through authenticating the IP Address with IIS. In code without implementing a very hacky solution we will only be able to obtain the user's IP Address.
However, by using IIS you can verify the 3rd party's address. This post from SO demonstrates how to do it. The post does not fit my case, but it does show you how to authenticate IP ranges.
Direct different IP's to different pages on IIS7