Class PasswordValidationCallback

java.lang.Object
javax.security.auth.message.callback.PasswordValidationCallback
All Implemented Interfaces:
Callback

public class PasswordValidationCallback extends Object implements Callback
Callback for PasswordValidation. This callback may be used by an authentication module to employ the password validation facilities of its containing runtime. This Callback would typically be called by a ServerAuthModule during validateRequest processing.
  • Constructor Details

    • PasswordValidationCallback

      public PasswordValidationCallback(Subject subject, String username, char[] password)
      Create a PasswordValidationCallback.
      Parameters:
      subject - The subject for authentication
      username - The username to authenticate
      password - tTe user's password, which may be null.
  • Method Details

    • getSubject

      public Subject getSubject()
      Get the subject.
      Returns:
      The subject.
    • getUsername

      public String getUsername()
      Get the username.
      Returns:
      The username.
    • getPassword

      public char[] getPassword()
      Get the password.

      Note that this method returns a reference to the password. If a clone of the array is created it is the caller's responsibility to zero out the password information after it is no longer needed.

      Returns:
      The password, which may be null.
    • clearPassword

      public void clearPassword()
      Clear the password.
    • setResult

      public void setResult(boolean result)
      Set the authentication result.
      Parameters:
      result - True if authentication succeeded, false otherwise
    • getResult

      public boolean getResult()
      Get the authentication result.
      Returns:
      True if authentication succeeded, false otherwise