Last post Mar 16, 2011 10:47 AM by Mohsin Khan
Mar 16, 2011 08:20 AM|Mohsin Khan|LINK
I am writing a custom HTTP module to implement user authentication and appropriate access rights. And for identifying access rights for the user also depends on identifying the client's machine details like IP address, machine name, etc. The access rights
will depend based on from which location or machine the user is trying to login.
Can we get these details from the HttpApplication or HttpContext object?
Many thanks in advance
Mar 16, 2011 10:41 AM|Mohsin Khan|LINK
I tried it at my end and was able to do as below to get the details:
void context_AuthorizeRequest (
context = (
HttpContext ) sender;
string hostName = app.Request.UserHostName;
Mar 16, 2011 10:47 AM|Mohsin Khan|LINK
There is also a simple and good article on codeproject (http://www.codeproject.com/KB/aspnet/http-module-ip-security.aspx)