Evolution-Data-Server Reference Manual: EAuthenticationMediator

## EAuthenticationMediator EAuthenticationMediator — Authenticator proxy for remote clients |

## Functions

ESourceAuthenticator * | e_authentication_mediator_new ()
GDBusConnection * | e_authentication_mediator_get_connection ()
const gchar * | e_authentication_mediator_get_object_path ()
const gchar * | e_authentication_mediator_get_sender ()
gboolean | e_authentication_mediator_wait_for_client_sync ()
void | e_authentication_mediator_wait_for_client ()
gboolean | e_authentication_mediator_wait_for_client_finish ()
void | e_authentication_mediator_dismiss ()
void | e_authentication_mediator_server_error ()

## Types and Values

struct | EAuthenticationMediator
struct | EAuthenticationMediatorClass

## Includes

    #include <libebackend/libebackend.h>

## Description

EAuthenticationMediator runs on the registry D-Bus service. It mediates authentication attempts between the client requesting authentication and the server-side EAuthenticationSession interacting with the user and/or secret service. It implements the ESourceAuthenticator interface and securely transmits passwords to a remote ESourceRegistry over D-Bus.

## Functions

### e_authentication_mediator_new ()

    ESourceAuthenticator *
    e_authentication_mediator_new (GDBusConnection *connection,
                                   const gchar *object_path,
                                   const gchar *sender,
                                   GError **error);

Creates a new EAuthenticationMediator and exports the Authenticator D-Bus interface on `connection` at `object_path` . If the Authenticator interface fails to export, the function sets `error` and returns `NULL`.

EAuthenticationMediator watches the bus name of the client requesting authentication, given by `sender` . If it sees the bus name vanish, it cancels the authentication session so the next authentication session can begin without delay.

#### Parameters

connection | a GDBusConnection |
object_path | object path of the authentication session |
sender | bus name of the client requesting authentication |
error | return location for a GError, or `NULL` |

#### Returns

an EAuthenticationMediator, or `NULL` on error

Since 3.6

### e_authentication_mediator_get_connection ()

    GDBusConnection *
    e_authentication_mediator_get_connection
                                   (EAuthenticationMediator *mediator);

Returns the GDBusConnection on which the Authenticator D-Bus interface is exported.

#### Parameters

mediator | an EAuthenticationMediator |

#### Returns

the GDBusConnection

Since 3.6

### e_authentication_mediator_get_object_path ()

    const gchar *
    e_authentication_mediator_get_object_path
                                   (EAuthenticationMediator *mediator);

Returns the object path at which the Authenticator D-Bus interface is exported.

#### Parameters

mediator | an EAuthenticationMediator |

#### Returns

the object path

Since 3.6

### e_authentication_mediator_get_sender ()

    const gchar *
    e_authentication_mediator_get_sender (EAuthenticationMediator *mediator);

Returns the authentication client's unique bus name.

#### Parameters

mediator | an EAuthenticationMediator |

#### Returns

the client's bus name

Since 3.6

### e_authentication_mediator_wait_for_client_sync ()

    gboolean
    e_authentication_mediator_wait_for_client_sync
                                   (EAuthenticationMediator *mediator,
                                    GCancellable *cancellable,
                                    GError **error);

Waits for the authentication client to indicate it is ready to begin authentication attempts. Call this function to synchronize with the client before initiating any authentication attempts through `mediator` .

If the authentication client's bus name vanishes or the client fails to signal it is ready before a timer expires, the function sets `error` and returns `FALSE`.

#### Parameters

mediator | an EAuthenticationMediator |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` if the client is ready, `FALSE` if an error occurred

Since 3.6

### e_authentication_mediator_wait_for_client ()

    void
    e_authentication_mediator_wait_for_client
                                   (EAuthenticationMediator *mediator,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously waits for the authentication client to indicate it is ready to being authentication attempts. Call this function to synchronize with the client before initiating any authentication attempts through `mediator` .

When the operation is finished, `callback` will be called. You can then call `e_authentication_mediator_wait_for_client_finished()` to get the result of the operation.

#### Parameters

mediator | an EAuthenticationMediator |
cancellable | optional GCancellable object, or `NULL` |
callback | a GAsyncReadyCallback to call when the request is satisfied |
user_data | data to pass to the callback function |

Since 3.6

### e_authentication_mediator_wait_for_client_finish ()

    gboolean
    e_authentication_mediator_wait_for_client_finish
                                   (EAuthenticationMediator *mediator,
                                    GAsyncResult *result,
                                    GError **error);

Finishes the operation started with `e_authentication_mediator_wait_for_client()`.

If the authentication client's bus name vanishes or the client fails to signal it is ready before a timer expires, the function sets `error` and returns `FALSE`.

#### Parameters

mediator | an EAuthenticationMediator |
result | a GAsyncResult |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` if the client is ready, `FALSE` if an error occurred

Since 3.6

### e_authentication_mediator_dismiss ()

    void
    e_authentication_mediator_dismiss (EAuthenticationMediator *mediator);

Signals to the authentication client that the user declined to provide a password when prompted and that the authentication session has terminated. This is also called when a server-side error has occurred, but the client doesn't need to know the difference.

#### Parameters

mediator | an EAuthenticationMediator |

Since 3.6

### e_authentication_mediator_server_error ()

    void
    e_authentication_mediator_server_error
                                   (EAuthenticationMediator *mediator,
                                    const GError *error);

Signals to the authentication client that the authentication session has terminated with a server-side error.

#### Parameters

mediator | an EAuthenticationMediator |
error | the GError to report |

Since 3.12

## Types and Values

### struct EAuthenticationMediator

    struct EAuthenticationMediator {
    };

Contains only private data that should be read and manipulated using the functions below.

Since 3.6

### struct EAuthenticationMediatorClass

    struct EAuthenticationMediatorClass {
    };

Class structure for the EAuthenticationMediator object

Since 3.6