Posts

Showing posts from April, 2009

Restrict Web Page access based on MAC / IP

This solution is a combination of .Net / Java applets. Java Applet is used to get the MAC from the client machine and then it is sent back to the server and there it will be used to restrict the client access or grant it access based on the ACL (Access Control List) defined in the XML. Java Applet to Get MAC Address : import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; import java.util.ArrayList; import java.applet.Applet; public class MacAddressApplet extends Applet { public static String sep = ":"; public static String format = "%02X"; /** * getMacAddress - return the first mac address found * separator - byte seperator default ":" * format - byte formatter default "%02X" * * @param ni - the network interface * @return String - the mac address as a string * @throws SocketException - pass it on */ public static String macToString( NetworkInterface ni ) throws SocketException { return macToString( ni,