WockyAuthRegistry

WockyAuthRegistry

Synopsis

GQuark              wocky_auth_error_quark              (void);
#define             WOCKY_AUTH_ERROR
enum                WockyAuthError;
#define             WOCKY_AUTH_MECH_JABBER_DIGEST
#define             WOCKY_AUTH_MECH_JABBER_PASSWORD
#define             WOCKY_AUTH_MECH_SASL_DIGEST_MD5
#define             WOCKY_AUTH_MECH_SASL_PLAIN
                    WockyAuthRegistryStartData;
                    WockyAuthRegistry;
                    WockyAuthRegistryClass;
                    WockyAuthRegistryPrivate;
void                (*WockyAuthRegistryStartAuthAsyncFunc)
                                                        (WockyAuthRegistry *self,
                                                         const GSList *mechanisms,
                                                         gboolean allow_plain,
                                                         gboolean is_secure_channel,
                                                         const gchar *username,
                                                         const gchar *password,
                                                         const gchar *server,
                                                         const gchar *session_id,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            (*WockyAuthRegistryStartAuthFinishFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         WockyAuthRegistryStartData **start_data,
                                                         GError **error);
void                (*WockyAuthRegistryChallengeAsyncFunc)
                                                        (WockyAuthRegistry *self,
                                                         const GString *challenge_data,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            (*WockyAuthRegistryChallengeFinishFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         GString **response,
                                                         GError **error);
void                (*WockyAuthRegistrySuccessAsyncFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            (*WockyAuthRegistrySuccessFinishFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         GError **error);
void                (*WockyAuthRegistryFailureFunc)     (WockyAuthRegistry *self,
                                                         GError *error);
WockyAuthRegistry * wocky_auth_registry_new             (void);
void                wocky_auth_registry_start_auth_async
                                                        (WockyAuthRegistry *self,
                                                         const GSList *mechanisms,
                                                         gboolean allow_plain,
                                                         gboolean is_secure_channel,
                                                         const gchar *username,
                                                         const gchar *password,
                                                         const gchar *server,
                                                         const gchar *session_id,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_auth_registry_start_auth_finish
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         WockyAuthRegistryStartData **start_data,
                                                         GError **error);
void                wocky_auth_registry_challenge_async (WockyAuthRegistry *self,
                                                         const GString *challenge_data,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_auth_registry_challenge_finish
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *res,
                                                         GString **response,
                                                         GError **error);
void                wocky_auth_registry_success_async   (WockyAuthRegistry *self,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            wocky_auth_registry_success_finish  (WockyAuthRegistry *self,
                                                         GAsyncResult *res,
                                                         GError **error);
void                wocky_auth_registry_add_handler     (WockyAuthRegistry *self,
                                                         WockyAuthHandler *handler);
void                wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data);
WockyAuthRegistryStartData * wocky_auth_registry_start_data_new
                                                        (const gchar *mechanism,
                                                         const GString *initial_response);
WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup
                                                        (WockyAuthRegistryStartData *start_data);
void                wocky_auth_registry_failure         (WockyAuthRegistry *self,
                                                         GError *error);

Object Hierarchy

  GObject
   +----WockyAuthRegistry

Description

Details

wocky_auth_error_quark ()

GQuark              wocky_auth_error_quark              (void);

Returns :


WOCKY_AUTH_ERROR

#define             WOCKY_AUTH_ERROR


enum WockyAuthError

typedef enum
{
  /* Failed to initialize our auth support */
  WOCKY_AUTH_ERROR_INIT_FAILED,
  /* Server doesn't support this authentication method */
  WOCKY_AUTH_ERROR_NOT_SUPPORTED,
  /* Server doesn't support any mechanisms that we support */
  WOCKY_AUTH_ERROR_NO_SUPPORTED_MECHANISMS,
  /* Couldn't send our stanzas to the server */
  WOCKY_AUTH_ERROR_NETWORK,
  /* Server sent an invalid reply */
  WOCKY_AUTH_ERROR_INVALID_REPLY,
  /* Failure to provide user credentials */
  WOCKY_AUTH_ERROR_NO_CREDENTIALS,
  /* Server sent a failure */
  WOCKY_AUTH_ERROR_FAILURE,
  /* disconnected */
  WOCKY_AUTH_ERROR_CONNRESET,
  /* XMPP stream error while authing */
  WOCKY_AUTH_ERROR_STREAM,
  /* Resource conflict (relevant in in jabber auth) */
  WOCKY_AUTH_ERROR_RESOURCE_CONFLICT,
  /* Provided credentials are not valid */
  WOCKY_AUTH_ERROR_NOT_AUTHORIZED,
} WockyAuthError;


WOCKY_AUTH_MECH_JABBER_DIGEST

#define WOCKY_AUTH_MECH_JABBER_DIGEST "X-WOCKY-JABBER-DIGEST"


WOCKY_AUTH_MECH_JABBER_PASSWORD

#define WOCKY_AUTH_MECH_JABBER_PASSWORD "X-WOCKY-JABBER-PASSWORD"


WOCKY_AUTH_MECH_SASL_DIGEST_MD5

#define WOCKY_AUTH_MECH_SASL_DIGEST_MD5 "DIGEST-MD5"


WOCKY_AUTH_MECH_SASL_PLAIN

#define WOCKY_AUTH_MECH_SASL_PLAIN "PLAIN"


WockyAuthRegistryStartData

typedef struct {
  gchar *mechanism;
  GString *initial_response;
} WockyAuthRegistryStartData;


WockyAuthRegistry

typedef struct _WockyAuthRegistry WockyAuthRegistry;


WockyAuthRegistryClass

typedef struct {
  GObjectClass parent_class;

  WockyAuthRegistryStartAuthAsyncFunc start_auth_async_func;
  WockyAuthRegistryStartAuthFinishFunc start_auth_finish_func;

  WockyAuthRegistryChallengeAsyncFunc challenge_async_func;
  WockyAuthRegistryChallengeFinishFunc challenge_finish_func;

  WockyAuthRegistrySuccessAsyncFunc success_async_func;
  WockyAuthRegistrySuccessFinishFunc success_finish_func;

  WockyAuthRegistryFailureFunc failure_func;
} WockyAuthRegistryClass;


WockyAuthRegistryPrivate

typedef struct _WockyAuthRegistryPrivate WockyAuthRegistryPrivate;


WockyAuthRegistryStartAuthAsyncFunc ()

void                (*WockyAuthRegistryStartAuthAsyncFunc)
                                                        (WockyAuthRegistry *self,
                                                         const GSList *mechanisms,
                                                         gboolean allow_plain,
                                                         gboolean is_secure_channel,
                                                         const gchar *username,
                                                         const gchar *password,
                                                         const gchar *server,
                                                         const gchar *session_id,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Starts a async authentication: chooses mechanism and gets initial data. The default function chooses a WockyAuthHandler by which mechanism it supports and gets the initial data from the chosen handler.

self :

mechanisms :

allow_plain :

is_secure_channel :

username :

password :

server :

session_id :

callback :

user_data :


WockyAuthRegistryStartAuthFinishFunc ()

gboolean            (*WockyAuthRegistryStartAuthFinishFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         WockyAuthRegistryStartData **start_data,
                                                         GError **error);

Called to finish the GAsyncResult task for authentication start. By default, * it extracts a WockyAuthRegistryStartData pointer from a given GSimpleAsyncResult and copies it to the out param.

self :

result :

start_data :

error :

Returns :


WockyAuthRegistryChallengeAsyncFunc ()

void                (*WockyAuthRegistryChallengeAsyncFunc)
                                                        (WockyAuthRegistry *self,
                                                         const GString *challenge_data,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Recieves a challenge and asynchronously provides a reply. By default the challenge is passed on to the chosen WockyAuthHandler.

self :

challenge_data :

callback :

user_data :


WockyAuthRegistryChallengeFinishFunc ()

gboolean            (*WockyAuthRegistryChallengeFinishFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         GString **response,
                                                         GError **error);

Finishes a GAsyncResult from WockyAuthRegistryChallengeAsyncFunc. By default it extracts a GString response from the given GSimpleAsyncResult and copies it to the out param.

self :

result :

response :

error :

Returns :


WockyAuthRegistrySuccessAsyncFunc ()

void                (*WockyAuthRegistrySuccessAsyncFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Notifies the registry of authentication success, and allows a last ditch attempt at aborting the authentication at the client's discretion.

self :

callback :

user_data :


WockyAuthRegistrySuccessFinishFunc ()

gboolean            (*WockyAuthRegistrySuccessFinishFunc)
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         GError **error);

Finishes a GAsyncResult from WockyAuthRegistrySuccessAsyncFunc. It checks for any errors set on the given GSimpleAsyncResult, copies the GError to an out param and returns FALSE if there was an error.

self :

result :

error :

Returns :


WockyAuthRegistryFailureFunc ()

void                (*WockyAuthRegistryFailureFunc)     (WockyAuthRegistry *self,
                                                         GError *error);

Notifies the client of a server-side error. By default this is not implemented.

self :

error :


wocky_auth_registry_new ()

WockyAuthRegistry * wocky_auth_registry_new             (void);

Returns :


wocky_auth_registry_start_auth_async ()

void                wocky_auth_registry_start_auth_async
                                                        (WockyAuthRegistry *self,
                                                         const GSList *mechanisms,
                                                         gboolean allow_plain,
                                                         gboolean is_secure_channel,
                                                         const gchar *username,
                                                         const gchar *password,
                                                         const gchar *server,
                                                         const gchar *session_id,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

self :

mechanisms :

allow_plain :

is_secure_channel :

username :

password :

server :

session_id :

callback :

user_data :


wocky_auth_registry_start_auth_finish ()

gboolean            wocky_auth_registry_start_auth_finish
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *result,
                                                         WockyAuthRegistryStartData **start_data,
                                                         GError **error);

self :

result :

start_data :

error :

Returns :


wocky_auth_registry_challenge_async ()

void                wocky_auth_registry_challenge_async (WockyAuthRegistry *self,
                                                         const GString *challenge_data,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

self :

challenge_data :

callback :

user_data :


wocky_auth_registry_challenge_finish ()

gboolean            wocky_auth_registry_challenge_finish
                                                        (WockyAuthRegistry *self,
                                                         GAsyncResult *res,
                                                         GString **response,
                                                         GError **error);

self :

res :

response :

error :

Returns :


wocky_auth_registry_success_async ()

void                wocky_auth_registry_success_async   (WockyAuthRegistry *self,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

self :

callback :

user_data :


wocky_auth_registry_success_finish ()

gboolean            wocky_auth_registry_success_finish  (WockyAuthRegistry *self,
                                                         GAsyncResult *res,
                                                         GError **error);

self :

res :

error :

Returns :


wocky_auth_registry_add_handler ()

void                wocky_auth_registry_add_handler     (WockyAuthRegistry *self,
                                                         WockyAuthHandler *handler);

self :

handler :


wocky_auth_registry_start_data_free ()

void                wocky_auth_registry_start_data_free (WockyAuthRegistryStartData *start_data);

start_data :


wocky_auth_registry_start_data_new ()

WockyAuthRegistryStartData * wocky_auth_registry_start_data_new
                                                        (const gchar *mechanism,
                                                         const GString *initial_response);

mechanism :

initial_response :

Returns :


wocky_auth_registry_start_data_dup ()

WockyAuthRegistryStartData * wocky_auth_registry_start_data_dup
                                                        (WockyAuthRegistryStartData *start_data);

start_data :

Returns :


wocky_auth_registry_failure ()

void                wocky_auth_registry_failure         (WockyAuthRegistry *self,
                                                         GError *error);

self :

error :