FileDocCategorySizeDatePackage
PasswordValidationCallback.javaAPI DocGlassfish v2 API4308Fri May 04 22:36:10 BST 2007javax.security.auth.message.callback

PasswordValidationCallback

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.
version
%I%, %G%

Fields Summary
private Subject
subject
private String
username
private char[]
password
private boolean
result
Constructors Summary
public PasswordValidationCallback(Subject subject, String username, char[] password)
Create a PasswordValidationCallback.

param
subject The subject for authentication
param
username The username to authenticate
param
password tTe user's password, which may be null.


                                 
     
                  
        this.subject = subject;
	this.username = username;
	if (password != null) {
	    this.password = (char[])password.clone();
	}
    
Methods Summary
public voidclearPassword()
Clear the password.

	if (password != null) {
	    Arrays.fill(password, ' ");
	}
    
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.

return
The password, which may be null.

	return password;
    
public booleangetResult()
Get the authentication result.

return
True if authentication succeeded, false otherwise

	return result;
    
public javax.security.auth.SubjectgetSubject()
Get the subject.

return
The subject.

        return subject;
    
public java.lang.StringgetUsername()
Get the username.

return
The username.

	return username;
    
public voidsetResult(boolean result)
Set the authentication result.

param
result True if authentication succeeded, false otherwise

	this.result = result;