NonSaslAuth Class Reference

This class is an implementation of JEP-0078 (Non-SASL Authentication). More...

#include <nonsaslauth.h>

Inherits IqHandler.

Inheritance diagram for NonSaslAuth:

Inheritance graph
[legend]
Collaboration diagram for NonSaslAuth:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NonSaslAuth (Client *parent, const std::string &sid)
virtual ~NonSaslAuth ()
void doAuth ()
virtual bool handleIq (Stanza *)
virtual bool handleIqID (Stanza *stanza, int context)

Detailed Description

This class is an implementation of JEP-0078 (Non-SASL Authentication).

It is invoked by Client automatically if supported by the server and if SASL authentication is not supported. You should not need to use this class manually.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.3

Definition at line 37 of file nonsaslauth.h.


Constructor & Destructor Documentation

NonSaslAuth Client parent,
const std::string &  sid
 

Constructor.

Parameters:
parent The ClientBase which is used to authenticate.
sid The session ID given by the server with the stream opening tag.

Definition at line 24 of file nonsaslauth.cpp.

References ClientBase::registerIqHandler().

~NonSaslAuth  )  [virtual]
 

Virtual Destructor.

Definition at line 31 of file nonsaslauth.cpp.

References ClientBase::removeIqHandler().


Member Function Documentation

void doAuth  ) 
 

Starts authentication by querying the server for the required authentication fields. Digest authentication is preferred over plain text passwords.

Definition at line 37 of file nonsaslauth.cpp.

References Tag::addAttrib(), Tag::addChild(), ClientBase::getID(), ClientBase::jid(), ClientBase::send(), JID::server(), ClientBase::trackID(), and Client::username().

Referenced by Client::nonSaslLogin().

virtual bool handleIq Stanza  )  [inline, virtual]
 

Reimplement this function if you want to be notified about incoming IQs.

Parameters:
stanza The complete Stanza.
Returns:
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 59 of file nonsaslauth.h.

bool handleIqID Stanza stanza,
int  context
[virtual]
 

Reimplement this function if you want to be notified about incoming IQs with a specific value of the id attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.

Parameters:
stanza The complete Stanza.
context A value to restore context, stored with ClientBase::trackID().
Returns:
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 54 of file nonsaslauth.cpp.

References gloox::CONN_AUTHENTICATION_FAILED, ClientBase::disconnect(), Tag::findChild(), Tag::hasAttribute(), Tag::hasChild(), gloox::NONSASL_CONFLICT, gloox::NONSASL_NOT_ACCEPTABLE, gloox::NONSASL_NOT_AUTHORIZED, ClientBase::setAuthed(), ClientBase::setAuthFailure(), gloox::STANZA_IQ_ERROR, and Stanza::subtype().


The documentation for this class was generated from the following files:
Generated on Mon Jan 16 16:19:59 2006 for gloox by  doxygen 1.4.6