WockyAuthHandler

WockyAuthHandler

Synopsis

                    WockyAuthHandler;
gboolean            (*WockyAuthInitialResponseFunc)     (WockyAuthHandler *handler,
                                                         GString **initial_data,
                                                         GError **error);
gboolean            (*WockyAuthAuthDataFunc)            (WockyAuthHandler *handler,
                                                         const GString *data,
                                                         GString **response,
                                                         GError **error);
gboolean            (*WockyAuthSuccessFunc)             (WockyAuthHandler *handler,
                                                         GError **error);
void                wocky_auth_handler_free             (WockyAuthHandler *handler);
const gchar *       wocky_auth_handler_get_mechanism    (WockyAuthHandler *handler);
gboolean            wocky_auth_handler_is_plain         (WockyAuthHandler *handler);
gboolean            wocky_auth_handler_get_initial_response
                                                        (WockyAuthHandler *handler,
                                                         GString **initial_data,
                                                         GError **error);
gboolean            wocky_auth_handler_handle_auth_data (WockyAuthHandler *handler,
                                                         const GString *data,
                                                         GString **response,
                                                         GError **error);
gboolean            wocky_auth_handler_handle_success   (WockyAuthHandler *handler,
                                                         GError **error);
                    WockyAuthHandlerIface;

Object Hierarchy

  GInterface
   +----WockyAuthHandler

Prerequisites

WockyAuthHandler requires GObject.

Description

Details

WockyAuthHandler

typedef struct _WockyAuthHandler WockyAuthHandler;


WockyAuthInitialResponseFunc ()

gboolean            (*WockyAuthInitialResponseFunc)     (WockyAuthHandler *handler,
                                                         GString **initial_data,
                                                         GError **error);

Called when authentication begins, if the mechanism allows a response to an implicit challenge during AUTH initiation (which, in XMPP, corresponds to sending the <auth></auth> stanza to the server).

The function should return TRUE on success and optionally set the initial_data to a string (allocated using g_malloc) if there is initial data to send. On error it should return FALSE and set the error

handler :

initial_data :

error :

Returns :


WockyAuthAuthDataFunc ()

gboolean            (*WockyAuthAuthDataFunc)            (WockyAuthHandler *handler,
                                                         const GString *data,
                                                         GString **response,
                                                         GError **error);

handler :

data :

response :

error :

Returns :


WockyAuthSuccessFunc ()

gboolean            (*WockyAuthSuccessFunc)             (WockyAuthHandler *handler,
                                                         GError **error);

Called when a <success></success> stanza is received during authentication. If no error is returned, then authentication is considered finished. (Typically, an error is only raised if the <success></success> stanza was received earlier than expected)

handler :

error :

Returns :


wocky_auth_handler_free ()

void                wocky_auth_handler_free             (WockyAuthHandler *handler);

handler :


wocky_auth_handler_get_mechanism ()

const gchar *       wocky_auth_handler_get_mechanism    (WockyAuthHandler *handler);

handler :

Returns :


wocky_auth_handler_is_plain ()

gboolean            wocky_auth_handler_is_plain         (WockyAuthHandler *handler);

handler :

Returns :


wocky_auth_handler_get_initial_response ()

gboolean            wocky_auth_handler_get_initial_response
                                                        (WockyAuthHandler *handler,
                                                         GString **initial_data,
                                                         GError **error);

handler :

initial_data :

error :

Returns :


wocky_auth_handler_handle_auth_data ()

gboolean            wocky_auth_handler_handle_auth_data (WockyAuthHandler *handler,
                                                         const GString *data,
                                                         GString **response,
                                                         GError **error);

handler :

data :

response :

error :

Returns :


wocky_auth_handler_handle_success ()

gboolean            wocky_auth_handler_handle_success   (WockyAuthHandler *handler,
                                                         GError **error);

handler :

error :

Returns :


WockyAuthHandlerIface

typedef struct {
    GTypeInterface parent;
    gchar *mechanism;
    gboolean plain;
    WockyAuthInitialResponseFunc initial_response_func;
    WockyAuthAuthDataFunc auth_data_func;
    WockyAuthSuccessFunc success_func;
} WockyAuthHandlerIface;

GTypeInterface parent;

The parent interface.

gchar *mechanism;

The AUTH mechanism which this handler responds to challenges for.

gboolean plain;

Whether the mechanism this handler handles sends secrets in plaintext.

WockyAuthInitialResponseFunc initial_response_func;

Called when the initial <auth></auth> stanza is generated

WockyAuthAuthDataFunc auth_data_func;

Called when any authentication data from the server is received

WockyAuthSuccessFunc success_func;

Called when a <success></success> stanza is received.