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 Summary
Constructors Constructor Description UsernamePasswordCredential(java.lang.String callerName, java.lang.String password)
Constructor.UsernamePasswordCredential(java.lang.String callerName, Password password)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCredential()
Invokes the specific subclass to securely clear the credential value.boolean
compareTo(java.lang.String callerName, java.lang.String password)
java.lang.String
getCaller()
Password
getPassword()
Determines the password.java.lang.String
getPasswordAsString()
Determines the password.-
Methods inherited from class javax.security.enterprise.credential.AbstractClearableCredential
clear, isCleared, setCleared
-
Methods inherited from interface javax.security.enterprise.credential.Credential
isValid
-
-
-
-
Constructor Detail
-
UsernamePasswordCredential
public UsernamePasswordCredential(java.lang.String callerName, java.lang.String password)
Constructor.- Parameters:
callerName
- The caller namepassword
- The password, as a String
-
UsernamePasswordCredential
public UsernamePasswordCredential(java.lang.String callerName, Password password)
Constructor.- Parameters:
callerName
- The caller namepassword
- The password
-
-
Method Detail
-
getPassword
public Password getPassword()
Determines the password.- Returns:
- The password.
-
getPasswordAsString
public java.lang.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
subclasses contain credential values which are inherently secure, such as tokens, for which clearing the credential may not be necessary.Credential
For example, if the credential includes a password, this method would overwrite the password value.
- Specified by:
clearCredential
in classAbstractClearableCredential
-
getCaller
public java.lang.String getCaller()
-
compareTo
public boolean compareTo(java.lang.String callerName, java.lang.String password)
-
-