org.jivesoftware.smack.sasl
Class SASLGSSAPIMechanism

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

public class SASLGSSAPIMechanism
extends SASLMechanism

Implementation of the SASL GSSAPI 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
SASLGSSAPIMechanism(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.
 
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
challengeReceived, handle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SASLGSSAPIMechanism

public SASLGSSAPIMechanism(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,
                         XMPPException
Builds and sends the auth stanza to the server. This overrides from the abstract class because the initial token needed for GSSAPI is binary, and not safe to put in a string, thus getAuthenticationText() cannot be used.

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 (not used with GSSAPI)
Throws:
java.io.IOException - If a network error occures while authenticating.
XMPPException - If a protocol error occurs or the user is not authenticated.

authenticate

public void authenticate(java.lang.String username,
                         java.lang.String host,
                         java.lang.String password)
                  throws java.io.IOException,
                         XMPPException
Builds and sends the auth stanza to the server. This overrides from the abstract class because the initial token needed for GSSAPI is binary, and not safe to put in a string, thus getAuthenticationText() cannot be used.

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 of the user (ignored for GSSAPI)
Throws:
java.io.IOException - If a network error occures while authenticating.
XMPPException - If a protocol error occurs or the user is not authenticated.