Class UsernamePasswordCredential

java.lang.Object
javax.security.enterprise.credential.AbstractClearableCredential
javax.security.enterprise.credential.UsernamePasswordCredential
All Implemented Interfaces:
Credential
Direct Known Subclasses:
BasicAuthenticationCredential

public class UsernamePasswordCredential extends AbstractClearableCredential
Represents the credentials typically used by standard caller name/password authentication.
  • Constructor Details

    • UsernamePasswordCredential

      public UsernamePasswordCredential(String callerName, String password)
      Constructor.
      Parameters:
      callerName - The caller name
      password - The password, as a String
    • UsernamePasswordCredential

      public UsernamePasswordCredential(String callerName, Password password)
      Constructor.
      Parameters:
      callerName - The caller name
      password - The password
  • Method Details

    • getPassword

      public Password getPassword()
      Determines the password.
      Returns:
      The password.
    • getPasswordAsString

      public String getPasswordAsString()
      Determines the password.
      Returns:
      The password, as a String.
    • clearCredential

      public void clearCredential()
      Description copied from class: AbstractClearableCredential
      Invokes the specific subclass to securely clear the credential value. Some Credential subclasses contain credential values which are inherently secure, such as tokens, for which clearing the credential may not be necessary.

      For example, if the credential includes a password, this method would overwrite the password value.

      Specified by:
      clearCredential in class AbstractClearableCredential
    • getCaller

      public String getCaller()
    • compareTo

      public boolean compareTo(String callerName, String password)