org.eclipse.net4j.util.security

## Interface IAuthenticator2

- All Superinterfaces:
    IAuthenticator

      public interface IAuthenticator2
      extends IAuthenticator

  Extension interface for authenticators that can update user credentials in addition to authenticating them.
  Since:
    3.4
  Author:
    Christian W. Damus (CEA LIST)

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isAdministrator(java.lang.String userID)` Queries whether a given user has administrative privileges.
    `void` | `resetPassword(java.lang.String adminID, char[] adminPassword, java.lang.String userID, char[] newPassword)` Performs an administrative resets of the password stored for the user identified by `userID`.
    `void` | `updatePassword(java.lang.String userID, char[] oldPassword, char[] newPassword)` Updates the password stored for the user identified by `userID`.

    - ### Methods inherited from interface org.eclipse.net4j.util.security.IAuthenticator

      `authenticate`

- - ### Method Detail

    - #### updatePassword

          void updatePassword(java.lang.String userID,
                              char[] oldPassword,
                              char[] newPassword)

      Updates the password stored for the user identified by `userID`. The `oldPassword` is authenticated as per usual and is replaced by the `newPassword` only (and atomically) on success.
      Parameters:
        `userID` - the ID of the user whose password is to be updated
        `oldPassword` - the user's current password attempt to verify against the stored password
        `newPassword` - the new password to replace the `oldPassword`
      Throws:
        `java.lang.SecurityException` - on any failure to authenticate the `oldPassword` or validate and/or set the `newPassword`

    - #### resetPassword

          void resetPassword(java.lang.String adminID,
                             char[] adminPassword,
                             java.lang.String userID,
                             char[] newPassword)

      Performs an administrative resets of the password stored for the user identified by `userID`. The `adminID` and `adminPassword` must authenticate to permit the `userID`'s password to be set to the `newPassword`.
      Parameters:
        `adminID` - the ID of the administrator requesting the reset
        `adminPassword` - the administrator's password
        `userID` - the ID of the user whose password is to be reset
        `newPassword` - the new password to replace the user's old password
      Throws:
        `java.lang.SecurityException` - on any failure to authenticate the `oldPassword` or validate and/or set the `newPassword`

    - #### isAdministrator

          boolean isAdministrator(java.lang.String userID)

      Queries whether a given user has administrative privileges.
      Parameters:
        `userID` - an user ID, which may or may not exist
      Returns:
        whether the userID exists and has administrative privileges

Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html