Smack

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
 
Field Summary
 
Fields inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticationId, hostname, password, sc
 
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.
protected  java.lang.String getName()
          Returns the common name of the SASL mechanism.
 
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticate, authenticate, challengeReceived, getSASLAuthentication, handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SASLGSSAPIMechanism

public SASLGSSAPIMechanism(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,
                         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.

Smack

Copyright © 2003-2007 Jive Software.