org.jabber.jabberbeans.Extension
Class IQAuth

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
        |
        +--org.jabber.jabberbeans.Extension.IQAuth
All Implemented Interfaces:
Extension, QueryExtension, java.io.Serializable
Direct Known Subclasses:
IQAuthExtension

public class IQAuth
extends XMLData
implements QueryExtension

An IQAuth object represents the jabber:iq:auth namespace. This namespace extension is used to specify the information needed to log into the jabber server.

This object can currently use 1 of 3 different strategies to authenticate with the server: Plaintext, Digest, or Zero Knowledge. Plaintext sends the password in plaintext, and is the least secure. Digest sends a SHA1 digest of the password to the server. Zero-Knowledge uses a shared-secret to authenticate the user without sending the password at all. Not all servers support all of these strategies: the client developer should determine which of these methods are supported and then supply the necessary information. If you provide IQAuth with data for more than 1 authentication strategy, it will try to use strategies in this order:

  1. Zero-Knowledge
  2. SHA1 Digest
  3. Plaintext

See Also:
Zero-Knowledge Specification, Simple Client Authentication Specification, Serialized Form

Constructor Summary
IQAuth(IQAuthBuilder builder)
          Creates a new IQAuthExtension instance.
 
Method Summary
 void appendItem(java.lang.StringBuffer retval)
          appendItem appends the XML representation of the current packet data to the specified StringBuffer.
 java.lang.String getPassword()
          getPassword returns the value used for the password.
 java.lang.String getResource()
          getResource returns the value of the resource attribute.
 java.lang.String getSHA1Digest()
          getSHA1Digest returns the value used for the SHA1 digest.
 java.lang.String getUsername()
          getUsername returns the value of the username attribute
 java.lang.String getZeroKHash()
           
 int getZeroKSequence()
           
 java.lang.String getZeroKToken()
           
 
Methods inherited from class org.jabber.jabberbeans.XMLData
appendAttrib, appendAttrib, appendChild, appendChild, escapeString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jabber.jabberbeans.Extension.Extension
toString
 

Constructor Detail

IQAuth

public IQAuth(IQAuthBuilder builder)
       throws java.lang.InstantiationException
Creates a new IQAuthExtension instance. This will fail if the builder does not have sufficient or correct information for an IQ Auth snippet.

Parameters:
builder - an IQAuthExtensionBuilder which holds the values we are using.
Throws:
java.lang.InstantiationException - thrown if the builder does not hold sufficient data to create a valid Extension snippet.
Method Detail

getUsername

public java.lang.String getUsername()
getUsername returns the value of the username attribute

Returns:
a String value

getResource

public java.lang.String getResource()
getResource returns the value of the resource attribute.

Returns:
a String value

getPassword

public java.lang.String getPassword()
getPassword returns the value used for the password.

Returns:
a String value

getSHA1Digest

public java.lang.String getSHA1Digest()
getSHA1Digest returns the value used for the SHA1 digest.

Returns:
a String value

getZeroKHash

public java.lang.String getZeroKHash()

getZeroKToken

public java.lang.String getZeroKToken()

getZeroKSequence

public int getZeroKSequence()

appendItem

public void appendItem(java.lang.StringBuffer retval)
appendItem appends the XML representation of the current packet data to the specified StringBuffer.

Specified by:
appendItem in interface Extension
Specified by:
appendItem in class XMLData
Parameters:
retval - The StringBuffer to append to