Class ApacheSQLAuthenticator

java.lang.Object
org.deltava.security.SQLAuthenticator
org.deltava.security.ApacheSQLAuthenticator
All Implemented Interfaces:
Closeable, AutoCloseable, Authenticator

public class ApacheSQLAuthenticator extends SQLAuthenticator
An Authenticator to authenticate users against Apache2-style database tables.
Since:
1.0
Version:
11.1
Author:
Luke
  • Constructor Details

    • ApacheSQLAuthenticator

      public ApacheSQLAuthenticator()
  • Method Details

    • authenticate

      public void authenticate(Person usr, String pwd) throws SecurityException
      Authenticates a user by validating the password against the database.
      Parameters:
      usr - the User bean
      pwd - the supplied password
      Throws:
      SecurityException - if a JDBC error occurs
    • accepts

      public boolean accepts(Person usr)
      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

      public boolean contains(Person usr) throws SecurityException
      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

      public void updatePassword(Person usr, String pwd) throws SecurityException
      Updates a User's password.
      Parameters:
      usr - the User bean
      pwd - the new password
      Throws:
      SecurityException - if a JDBC error occurs
    • add

      public void add(Person usr, String pwd) throws SecurityException
      Adds a user to the Directory.
      Parameters:
      usr - the User bean
      pwd - the User's password
      Throws:
      SecurityException - if a JDBC error occurs
    • rename

      public void rename(Person usr, String newName) throws SecurityException
      Renames a user in the Directory.
      Parameters:
      usr - the user bean
      newName - the new fully-qualified directory
      Throws:
      SecurityException - if an error occurs
    • disable

      public void disable(Person usr) throws SecurityException
      Disables a user's account.
      Parameters:
      usr - the user bean
      Throws:
      SecurityException - if an error occurs
    • remove

      public void remove(Person usr) throws SecurityException
      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