Smack

org.jivesoftware.smack.sasl
Class SASLPlainMechanism

java.lang.Object
  extended by org.jivesoftware.smack.sasl.SASLMechanism
      extended by org.jivesoftware.smack.sasl.SASLPlainMechanism

public class SASLPlainMechanism
extends SASLMechanism

Implementation of the SASL PLAIN mechanisn as defined by the IETF draft document.

Author:
Gaston Dombiak

Constructor Summary
SASLPlainMechanism(SASLAuthentication saslAuthentication)
           
 
Method Summary
protected  String getAuthenticationText(String username, String host, String password)
          Returns the authentication text to include in the initial auth stanza or null if nothing should be added.
protected  String getChallengeResponse(byte[] bytes)
          Returns the response text to send answering the challenge sent by the server.
protected  String getName()
          Returns the common name of the SASL mechanism.
 
Methods inherited from class org.jivesoftware.smack.sasl.SASLMechanism
authenticate, challengeReceived, getSASLAuthentication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SASLPlainMechanism

public SASLPlainMechanism(SASLAuthentication saslAuthentication)
Method Detail

getName

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

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

getAuthenticationText

protected String getAuthenticationText(String username,
                                       String host,
                                       String password)
Description copied from class: SASLMechanism
Returns the authentication text to include in the initial auth stanza or null if nothing should be added.

Specified by:
getAuthenticationText 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.
Returns:
the authentication text to include in the initial auth stanza or null if nothing should be added.

getChallengeResponse

protected String getChallengeResponse(byte[] bytes)
Description copied from class: SASLMechanism
Returns the response text to send answering the challenge sent by the server. Mechanisms that will never receive a challenge may redefine this method returning null.

Specified by:
getChallengeResponse in class SASLMechanism
Parameters:
bytes - the challenge sent by the server.
Returns:
the response text to send to answer the challenge sent by the server.

Smack

Copyright © 2003-2007 Jive Software.