Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I have a web application in which I want to block an autorized user(who have a username and password to login) from other computer other than his alloted office computer. If the user try to access the Web appln from his home or from other computer in his office, I want to block him..How can I implement that?
Can any one help me..please...it's urgent...
Posted
Updated 2-May-11 19:46pm
v2
Comments
Bryian Tan 3-May-11 0:22am    
You can code the application to allow IP address from the office to login. Restrict the user to access the application if the IP is not from the office computer.
pufo 3-May-11 1:31am    
But I think its easy to duplicate IPaddress.. How about MAC address?

Track the IPAddress and check it as a credential with the loginID and password.
 
Share this answer
 
Comments
pufo 3-May-11 2:40am    
Thanks for you help rahultandon... but is this ipaddress is secure enough?
Hi there,

Assuming that you have the authority to take the decision, what I would do is,

Alert all the users not to use the application only from their respective machines and that their usage is tracked. In your application log the access of your application and store these data (machine name, ipaddress, user name, date and time).

You can develop a view for a system administrators to see who has logged in from different locations :) or even generate an email to be sent to configured addresses when a user does that.

Why I suggested this approach to you is for multiple reasons, which are:
1. If you use the IP filtering approach, you have to keep track of all the employees, machine names and IP addresses in your database and update the database as in when a change happens, which would be difficult to maintain in a long run.
2. You mentioned that this application is running in your office, so even though some users may be give the permissions to change the IP addresses, I am sure they are not allowed to change machine name which would cause the computer to be added to the domain again, which needs network administrator level access (which am sure not many people would have). So it is better than the IPAddress in the sense.
3. The reason for the IPAddress to be there is just so that you can clearly differentiate between office IPs and other IPs. But if you host this application in your Intranet, you could easily overcome this problem, since anyone outside cannot access your intranet without a VPN.
4. Since it only generates an email or a notification to the configured users (System administrators or managers, etc) you can review the list and generate weekly reports and advice the users on such behavior.
5. Date and time is mainly for querying results for a specific time period, useful when and if generating reports off this data.

Hope this helps :) Regards
 
Share this answer
 
Comments
pufo 3-May-11 3:44am    
Thank you so much PasanRatnayake.. :)
It will be useful.. but this application will not be in the office machine, and will be out side (in a server machine)..
thank you..
CodeHawkz 3-May-11 4:28am    
If this is hosted in a public domain instead of a machine on the intranet, I strongly suggest do not go for IP filtering, because it is not practical. It would be really hard to maintain.

For me, it does not make sense to host your internal website in a public domain and try to restrict access by IPs. It would be soo simple and effective to host in a server within your network which is not accessible through internet. Then, all you have to worry about is users accessing it from a different PC instead of his/her own pc :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900