Question

I'm writing a web forms application where users should only be able to access the site from a designated computer linked to the specific user.

I'm using default ASP.net Membership to handle the user login process.

My current train of thought is to save the computer's machine name (using System.Net.Dns.GetHostName) against the userId and when a user logs in, check the computer's name against the user trying to log in. If that user is not allowed to access the site from the machine then access will be denied. Problem is some users are using Macs to access the site and having very limited Mac experience, I'm not sure if I'll be able to use this approach. Or if this is even the best approach to take for this task in general.

Googling didn't turn up much results. Can anyone provide me with a platform independent way to identify the client machine or if I'm missing the plot completely in how I'm approaching this just point me in the right direction for further research?

EDIT I have abandoned this approach in favour of using SSL and Client Certificate Authentication instead

No correct solution

OTHER TIPS

You would use...

Request.UserHostName

http://msdn.microsoft.com/en-us/library/system.web.httprequest.userhostname(v=vs.110).aspx

I am not sure if Mac will provide that information. The client browser has a lot to do with which information is available to the server about the client. The Request object is where you want to look for that information, though. If you have access to a Mac, or can get a Mac user to hit a test page, you can log the server variables that are provided to you to help determine the best approach. An example of this is provided in MSDN documentation:

http://msdn.microsoft.com/en-us/library/system.web.httprequest.headers(v=vs.110).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top