# Migrating from libsignon-glib 1.x to libsignon-glib 2.x

The whole API has been reworked to be easily usable with the GObject Introspection. It now fully uses the #GTask API internally and provides the expected asynchronous functions instead of relying on callbacks.

This helps to keep the objects lifecycle sane across the projects. But it required some invasive changes in the API.

## Changes in #SignonAuthService

signon_auth_service_query_mechanisms() has been changed into signon_auth_service_get_mechanisms(). There is no more custom callback to use, only the #GAsyncResult API. Use signon_auth_service_get_mechanisms_finish() in your #GAsyncReadyCallback to get the mechanisms.

In a same manner signon_auth_service_query_methods() has been changed to signon_auth_service_get_methods().

There are now synchronous methods to get the methods and mechanisms.

## Changes in #SignonAuthSession

The long deprecated signon_auth_session_process() has been removed and the signon_auth_session_process_async() method has been renamed to signon_auth_session_process() as asynchronous methods are the default way to use this API.

signon_auth_session_query_available_mechanisms() has been removed and can be replaced by signon_auth_service_get_mechanisms() with a manual filtering if needed.

## Changes in #SignonIdentity

signon_identity_store_credentials_with_args() has been completely removed, only signon_identity_store_info() should be used.

signon_identity_store_credentials_with_info() has been renamed to signon_identity_store_info() as #SignonIdentityInfo is the only way to get and set the identity informations.

signon_identity_add_reference() and signon_identity_remove_reference() have been completely removed without replacement.

The "id" property is now read-only and only settable at construction time. There is a new signon_identity_get_id() method to easily get the value of the property. The object now notifies when the property has changed with a property signal emition.

The "signout" signal has been renamed to #SignonIdentity::signed-out to be more descriptive and avoid symbol collisions with the signon_identity_sign_out() method.

The signon_identity_signout() has been renamed to signon_identity_sign_out() to avoid symbol collisions with the "signout" signal.

All the methods have been modified to use the #GAsyncResult API. Use *_finish() in your #GAsyncReadyCallback to get the result of the operation.

signon_identity_info_get_access_control_list() and signon_identity_info_set_access_control_list() now make use of the new #SignonSecurityContext structure that replaces the simple security context string.