Class LDAPAuthenticator
java.lang.Object
org.deltava.security.LDAPAuthenticator
- All Implemented Interfaces:
Closeable,AutoCloseable,Authenticator
An authenticator to validate users against an LDAP server.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
FieldsFields inherited from interface org.deltava.security.Authenticator
DEFAULT_PROPS_FILE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis Authenticator accepts all users with a valid Directory Name.voidAdds a User to the Directory.voidauthenticate(Person usr, String pwd) Authenticates the user by doing an LDAP bind operation and checking if it succeeded.booleanChecks if a particular name exists in the Directory.voidDisables a user's account.voidInitializes the authenticator.voidRemoves a User from the Directory.voidRenames a user in the Directory.voidupdatePassword(Person usr, String pwd) Updates a user's password.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.deltava.security.Authenticator
close
-
Field Details
-
log
-
_env
-
-
Constructor Details
-
LDAPAuthenticator
public LDAPAuthenticator()
-
-
Method Details
-
init
Initializes the authenticator.- Specified by:
initin interfaceAuthenticator- Parameters:
propsFile- the properties file to use- Throws:
SecurityException- if an error occurs
-
authenticate
Authenticates the user by doing an LDAP bind operation and checking if it succeeded.- Specified by:
authenticatein interfaceAuthenticator- Parameters:
usr- the user beanpwd- the user's password- Throws:
SecurityException- if authentication fails for any reason, contained within the cause of the exception.- See Also:
-
updatePassword
Updates a user's password.- Specified by:
updatePasswordin interfaceAuthenticator- Parameters:
usr- the user beanpwd- the new password- Throws:
SecurityException- if an error occurs
-
add
Adds a User to the Directory.- Specified by:
addin interfaceAuthenticator- Parameters:
usr- the user beanpwd- the User's password- Throws:
SecurityException- if an error occurs
-
contains
Checks if a particular name exists in the Directory.- Specified by:
containsin interfaceAuthenticator- Parameters:
usr- the user bean- Returns:
- TRUE if the user exists, otherwise FALSE
- Throws:
SecurityException- if an error occurs
-
accepts
This Authenticator accepts all users with a valid Directory Name.- Specified by:
acceptsin interfaceAuthenticator- Parameters:
usr- the user bean- Returns:
- TRUE if the user's DN property is not empty
-
disable
Disables a user's account. This deletes the User.- Specified by:
disablein interfaceAuthenticator- Parameters:
usr- the user bean- Throws:
SecurityException- if an error occurs
-
remove
Removes a User from the Directory.- Specified by:
removein interfaceAuthenticator- Parameters:
usr- the user bean- Throws:
SecurityException- if an error occurs
-
rename
Renames a user in the Directory.- Specified by:
renamein interfaceAuthenticator- Parameters:
usr- the user beannewName- the new fully-qualified directory- Throws:
SecurityException- if an error occurs
-