5.2. The ANONYMOUS mechanism

The ANONYMOUS mechanism is used to “authenticate” clients to anonymous services; or rather just indicate that the client wishes to use the service anonymously. The client sends a token, usually her email address.

This mechanism is only enabled in the client and server if you implement the respectively callbacks below and set them in the library (Chapter 7).

int (*Gsasl_client_callback_anonymous) (Gsasl_session_ctx * ctx, char * out, size_t * outlen) ctx: libgsasl handle.

out: output array with client token.

outlen: on input the maximum size of the output array, on output contains the actual size of the output array.

Type of callback function the application implements. It should populate the output array with some input from the user and set the output array length, and return GSASL_OK, or fail with an error code.

If OUT is NULL, the function should only populate the output length field with the length, and return GSASL_OK. This usage may be used by the caller to allocate the proper buffer size.

int (*Gsasl_server_callback_anonymous) (Gsasl_session_ctx * ctx, const char * token) ctx: libgsasl handle.

ctx: output array with client token.

ctx: on input the maximum size of the output array, on output contains the actual size of the output array. If OUT is

Type of callback function the application implements. It should return GSASL_OK if user should be permitted anonymous access, otherwise GSASL_AUTHENTICATION_ERROR.