Class PasswordValidationCallback
- java.lang.Object
-
- javax.security.auth.message.callback.PasswordValidationCallback
-
- All Implemented Interfaces:
javax.security.auth.callback.Callback
public class PasswordValidationCallback extends java.lang.Object implements javax.security.auth.callback.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.
- Since:
- May 11, 2006
- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description private char[]
password
private boolean
resultOfAuthentication
private javax.security.auth.Subject
subject
private java.lang.String
username
-
Constructor Summary
Constructors Constructor Description PasswordValidationCallback(javax.security.auth.Subject subject, java.lang.String username, char[] password)
Create a PasswordValidationCallback.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearPassword()
Clear the password.char[]
getPassword()
Get the password.boolean
getResult()
Get the authentication result.javax.security.auth.Subject
getSubject()
Get the subject.java.lang.String
getUsername()
Get the username.void
setResult(boolean result)
Set the authentication result.
-
-
-
Constructor Detail
-
PasswordValidationCallback
public PasswordValidationCallback(javax.security.auth.Subject subject, java.lang.String username, char[] password)
Create a PasswordValidationCallback.
- Parameters:
subject
- The subject for authenticationusername
- The username to authenticatepassword
- The user's password, which may be null.
-
-
Method Detail
-
clearPassword
public void clearPassword()
Clear the password.
-
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.
-
getSubject
public javax.security.auth.Subject getSubject()
Get the subject.
- Returns:
- The subject.
-
getResult
public boolean getResult()
Get the authentication result.
- Returns:
- true if authentication succeeded, false otherwise.
-
getUsername
public java.lang.String getUsername()
Get the username.
- Returns:
- The username.
-
setResult
public void setResult(boolean result)
Set the authentication result.
- Parameters:
result
- True if authentication succeeded, false otherwise.
-
-