org.jivesoftware.smack.sasl
Class SASLAnonymous

java.lang.Object
  extended by org.jivesoftware.smack.sasl.SASLMechanism
      extended by org.jivesoftware.smack.sasl.SASLAnonymous
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public class SASLAnonymous
extends SASLMechanism

Implementation of the SASL ANONYMOUS mechanism

Author:
Jay Kline

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.sasl.SASLMechanism
SASLMechanism.AuthMechanism, SASLMechanism.Challenge, SASLMechanism.Failure, SASLMechanism.Response, SASLMechanism.Success
 
Constructor Summary
SASLAnonymous(SASLAuthentication saslAuthentication)
           
 
Method Summary
 void authenticate(java.lang.String username, java.lang.String host, javax.security.auth.callback.CallbackHandler cbh)
          Builds and sends the auth stanza to the server.
 void authenticate(java.lang.String username, java.lang.String host, java.lang.String password)
          Builds and sends the auth stanza to the server.
 void challengeReceived(java.lang.String challenge)
          The server is challenging the SASL mechanism for the stanza he just sent.
 
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
handle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SASLAnonymous

public SASLAnonymous(SASLAuthentication saslAuthentication)
Method Detail

authenticate

public void authenticate(java.lang.String username,
                         java.lang.String host,
                         javax.security.auth.callback.CallbackHandler cbh)
                  throws java.io.IOException
Description copied from class: SASLMechanism
Builds and sends the auth stanza to the server. The callback handler will handle any additional information, such as the authentication ID or realm, if it is needed.

Overrides:
authenticate in class SASLMechanism
Parameters:
username - the username of the user being authenticated.
host - the hostname where the user account resides.
cbh - the CallbackHandler to obtain user information.
Throws:
java.io.IOException - If a network error occures while authenticating.

authenticate

public void authenticate(java.lang.String username,
                         java.lang.String host,
                         java.lang.String password)
                  throws java.io.IOException
Description copied from class: SASLMechanism
Builds and sends the auth stanza to the server. Note that this method of authentication is not recommended, since it is very inflexable. Use SASLMechanism.authenticate(String, String, CallbackHandler) whenever possible.

Overrides:
authenticate in class SASLMechanism
Parameters:
username - the username of the user being authenticated.
host - the hostname where the user account resides.
password - the password for this account.
Throws:
java.io.IOException - If a network error occurs while authenticating.

challengeReceived

public void challengeReceived(java.lang.String challenge)
                       throws java.io.IOException
Description copied from class: SASLMechanism
The server is challenging the SASL mechanism for the stanza he just sent. Send a response to the server's challenge.

Overrides:
challengeReceived in class SASLMechanism
Parameters:
challenge - a base64 encoded string representing the challenge.
Throws:
java.io.IOException - if an exception sending the response occurs.