-1

How to restrict login to a website inside an office only in Java? I want to restrict the access of a site only when they are in office but provide some people can access at any where

1 Answers1

1

A MAC-address will only be visible to a server that's on the same local area network (and subnet) as the client, thus you will never be able to see the true MAC-address of a user who's at home, or otherwise outside the 'range' of the subnet your server is on... It's kind of hard to explain to someone who do not have extensive network understanding - and I assume you don't.

You have a couple of choices:

1) Restrict the website to your office only, and allow VPN-clients access to your network and thus also your website + provide your clients with VPN-capabilities.

2) Setup a proxy that only allows ip-addresses from your local area network and disallows the others

3) Design and implement a security-scheme in your website that compares the IP-address of the client to a 'whitelist' of some sort, and then allow/disallow the user.

OddBeck
  • 815
  • 7
  • 18
  • can i restrict through subnet mask id? – user3906140 Aug 04 '14 at 10:39
  • I have added details of my requirement – user3906140 Aug 04 '14 at 11:15
  • I'm not sure I understand what you're asking. The subnet mask is something that sets the range of a subset of IP-adresses. This if you have an IP-address of 10.1.1.9, it will match 10.1.1.0/255.255.255.240, but it won't match 10.1.1.0/255.255.255.248. If you don't understand subnets and netmasks, then forget this whole ordeal. Of the 3 possible scenarios I posted as a way to go, which one would suit you best? – OddBeck Aug 04 '14 at 12:30