Class ApacheSQLAuthenticator
java.lang.Object
org.deltava.security.SQLAuthenticator
org.deltava.security.ApacheSQLAuthenticator
- All Implemented Interfaces:
Closeable,AutoCloseable,Authenticator
An Authenticator to authenticate users against Apache2-style database tables.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.security.SQLAuthenticator
_propsFields inherited from interface org.deltava.security.Authenticator
DEFAULT_PROPS_FILE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis Authenticator will accept all users.voidAdds a user to the Directory.voidauthenticate(Person usr, String pwd) Authenticates a user by validating the password against the database.booleanChecks if a particular name exists in the Directory.voidDisables a user's account.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 org.deltava.security.SQLAuthenticator
close, getConnection, init, setConnection
-
Constructor Details
-
ApacheSQLAuthenticator
public ApacheSQLAuthenticator()
-
-
Method Details
-
authenticate
Authenticates a user by validating the password against the database.- Parameters:
usr- the User beanpwd- the supplied password- Throws:
SecurityException- if a JDBC error occurs
-
accepts
This Authenticator will accept all users.- Parameters:
usr- the user bean- Returns:
- TRUE if the user will be added to the Directory if requested, otherwise FALSE
-
contains
Checks if a particular name exists in the Directory.- Parameters:
usr- the user bean- Returns:
- TRUE if the user exists, otherwise FALSE
- Throws:
SecurityException- if a JDBC error occurs
-
updatePassword
Updates a User's password.- Parameters:
usr- the User beanpwd- the new password- Throws:
SecurityException- if a JDBC error occurs
-
add
Adds a user to the Directory.- Parameters:
usr- the User beanpwd- the User's password- Throws:
SecurityException- if a JDBC error occurs
-
rename
Renames a user in the Directory.- Parameters:
usr- the user beannewName- the new fully-qualified directory- Throws:
SecurityException- if an error occurs
-
disable
Disables a user's account.- Parameters:
usr- the user bean- Throws:
SecurityException- if an error occurs
-
remove
Removes a user from the Directory. This will fail silently if the user does not exist in the Directory.- Parameters:
usr- the user bean- Throws:
SecurityException- if a JDBC error occurs
-