Author: saurabh.surana | Posted on: 8/6/2010 9:17:59 AM | Views : 380

Hi,
I am writing a web application which accepts the data over HTTP post.
I want to make sure that I accept the request only from specific IP address or range of IP Address. For this purpose I looked at how I can retrieve the IP address of the client, I found that there are few ways of doing this:
1) Host header in the HTTP Request.
2) HttpContext.Current.Request.UserHostAddress
3) Request.ServerVariables["REMOTE_ADDR"]
I want to know which is the best approach where in a malicious user is not able spoof the packet and send the the IP which I trust in that filed.
I know that certificate based mechanism will be like the best one to have. but its quiet complex and since I don't have the control over the client application (which will send me the data) it will be quiet an task to get it in place and working as per the expectation.
What I was thinking is, if the IP address provided by these parameters is somet ...

Go to the complete details ...