Interface Authenticator

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ApacheFileAuthenticator, ApacheSQLAuthenticator, FileAuthenticator, FSDAuthenticator, LDAPAuthenticator, MigrationAuthenticator, MirrorAuthenticator, MultiAuthenticator, SQLAuthenticator

public interface Authenticator extends Closeable
An interface for user authenticators.
Since:
1.0
Version:
9.0
Author:
Luke
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default properties file used for authenticator configuration options.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if a particular user should exist within a Directory.
    void
    add(Person usr, String pwd)
    Adds a user to the Directory.
    void
    Authenticate a particular user given a set of credentials.
    default void
     
    boolean
    Checks if a particular user exists in the Directory.
    void
    Disables a user's account in the Directory.
    void
    init(String propsFile)
    Initializes the authenticator.
    void
    Removes a user from the Directory.
    void
    rename(Person usr, String newName)
    Renames a user in the Directory.
    void
    Updates a user's password.
  • Field Details

    • DEFAULT_PROPS_FILE

      static final String DEFAULT_PROPS_FILE
      Default properties file used for authenticator configuration options.
      See Also:
  • Method Details

    • init

      void init(String propsFile) throws SecurityException
      Initializes the authenticator.
      Parameters:
      propsFile - the properties file to use
      Throws:
      SecurityException - if an error occurs
    • authenticate

      void authenticate(Person usr, String pwd) throws SecurityException
      Authenticate a particular user given a set of credentials.
      Parameters:
      usr - the user bean
      pwd - the password
      Throws:
      SecurityException - if the authentication failed for any reason
    • contains

      boolean contains(Person usr) throws SecurityException
      Checks if a particular user exists in the Directory.
      Parameters:
      usr - the user bean
      Returns:
      TRUE if the user exists, otherwise FALSE
      Throws:
      SecurityException - if an error occurs
    • accepts

      boolean accepts(Person usr)
      Checks if a particular user should exist within a Directory. Not all Authenticators will include all users, and to avoid errors in MultiAuthenticator implementations, this method is included to validate which authenticators credentials should be cascaded to.
      Parameters:
      usr - the user bean
      Returns:
      TRUE if the user will be added to the Directory if requested, otherwise FALSE
    • updatePassword

      void updatePassword(Person usr, String pwd) throws SecurityException
      Updates a user's password. If the authenticator supports the accepts(Person) method, then the user account should be re-enabled.
      Parameters:
      usr - the user bean
      pwd - the new password
      Throws:
      SecurityException - if an error occurs
    • add

      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 an error occurs
    • disable

      void disable(Person usr) throws SecurityException
      Disables a user's account in the Directory. This is an optional operation, if an implementation does not support this operation it should call remove(Person) instead.
      Parameters:
      usr - the user bean
      Throws:
      SecurityException - if an error occurs
    • rename

      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
    • remove

      void remove(Person usr) throws SecurityException
      Removes a user from the Directory.
      Parameters:
      usr - the user bean
      Throws:
      SecurityException - if an error occurs
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable