Smack

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
 
Field Summary
 
Fields inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticationId, hostname, password, sc
 
Constructor Summary
SASLAnonymous(SASLAuthentication saslAuthentication)
           
 
Method Summary
protected  void authenticate()
           
 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)
          Same as SASLMechanism.authenticate(String, String, String, String), but with the hostname used as the serviceName.
 void challengeReceived(java.lang.String challenge)
          The server is challenging the SASL mechanism for the stanza he just sent.
protected  java.lang.String getName()
          Returns the common name of the SASL mechanism.
 
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticate, getSASLAuthentication, handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SASLAnonymous

public SASLAnonymous(SASLAuthentication saslAuthentication)
Method Detail

getName

protected java.lang.String getName()
Description copied from class: SASLMechanism
Returns the common name of the SASL mechanism. E.g.: PLAIN, DIGEST-MD5 or GSSAPI.

Specified by:
getName in class SASLMechanism
Returns:
the common name of the SASL mechanism.

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
Same as SASLMechanism.authenticate(String, String, String, String), but with the hostname used as the serviceName.

Kept for backward compatibility only.

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.

authenticate

protected void authenticate()
                     throws java.io.IOException
Overrides:
authenticate in class SASLMechanism
Throws:
java.io.IOException

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.

Smack

Copyright © 2003-2007 Jive Software.