| D:\DEV\PROJECTS\Harbor_Server\src\java\harbor\security\extension\UserAudit.java |
/* * UserAudit.java */ package harbor.security.extension; import kewlstuff.harbor.servlet.I_UserAudit; /** * @author JK * This hook allows one to take precedence over the default security file system, for the user. * It allows one to create custom schemes that obtain user information from a database * or LDAP server, or anything else. * This class or Jar when included in Web-Inf/Libs, will activate on a server restart. * or when ReloadClassRoles is called from the Admin Console. */ public class UserAudit implements I_UserAudit{ //Called when ClassRoles are loaded by system or Admin public UserAudit() { } //Interface //Called when user and pass need to be authenticated //return true if authenticated //returning false, means the system will then look at the security files. public boolean auditCredentials(String sUserID, String sPass){ //Your CODE HERE //eg: dig the password out of a database and compare, or use LDAP return false; } //Interface //Called when user roles are needed by the system //return array of roles that this user belongs to. //returning null, the system will then look at the security files. public String[] getUserRoles(String sUserID){ //Your CODE HERE //eg: //String[] testRoles = {"testusers","aerobicsClub","SpecialAgents"}; //return testRoles; return null; } }