org.apache.qpid.server.security.auth.sasl.plain
Class PlainPasswordCallback

java.lang.Object
  extended by javax.security.auth.callback.PasswordCallback
      extended by org.apache.qpid.server.security.auth.sasl.plain.PlainPasswordCallback
All Implemented Interfaces:
Serializable, Callback

public class PlainPasswordCallback
extends PasswordCallback

Custom PasswordCallback for use during the PLAIN authentication process. To be used in combination with PrincipalDatabase implementations that can either set a plain text value in the parent callback, or use the setAuthenticated(bool) method after observing the incoming plain text. isAuthenticated() should then be used to determine the final result.

See Also:
Serialized Form

Constructor Summary
PlainPasswordCallback(String prompt, boolean echoOn, String plainPassword)
          Constructs a new PlainPasswordCallback with the incoming plain text password.
 
Method Summary
 String getPlainPassword()
           
 boolean isAuthenticated()
          Method to determine if the incoming plain password is authenticated
 void setAuthenticated(boolean authenticated)
           
 
Methods inherited from class javax.security.auth.callback.PasswordCallback
clearPassword, getPassword, getPrompt, isEchoOn, setPassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainPasswordCallback

public PlainPasswordCallback(String prompt,
                             boolean echoOn,
                             String plainPassword)
Constructs a new PlainPasswordCallback with the incoming plain text password.

Throws:
NullPointerException - if the incoming plain text is null
Method Detail

getPlainPassword

public String getPlainPassword()

setAuthenticated

public void setAuthenticated(boolean authenticated)

isAuthenticated

public boolean isAuthenticated()
Method to determine if the incoming plain password is authenticated

Returns:
true if the stored password matches the incoming text, or setAuthenticated(true) has been called


Licensed to the Apache Software Foundation