Top |
Functions
GsAuth * | gs_auth_new () |
const gchar * | gs_auth_get_provider_id () |
const gchar * | gs_auth_get_provider_name () |
void | gs_auth_set_provider_name () |
const gchar * | gs_auth_get_provider_logo () |
void | gs_auth_set_provider_logo () |
const gchar * | gs_auth_get_provider_uri () |
void | gs_auth_set_provider_uri () |
const gchar * | gs_auth_get_provider_schema () |
void | gs_auth_set_provider_schema () |
const gchar * | gs_auth_get_username () |
void | gs_auth_set_username () |
const gchar * | gs_auth_get_password () |
void | gs_auth_set_password () |
const gchar * | gs_auth_get_pin () |
void | gs_auth_set_pin () |
GsAuthFlags | gs_auth_get_flags () |
void | gs_auth_set_flags () |
void | gs_auth_add_flags () |
gboolean | gs_auth_has_flag () |
const gchar * | gs_auth_get_metadata_item () |
void | gs_auth_add_metadata () |
gboolean | gs_auth_store_load () |
gboolean | gs_auth_store_save () |
Description
This object represents user data used for authentication. This data is shared between all plugins.
Functions
gs_auth_get_provider_id ()
const gchar *
gs_auth_get_provider_id (GsAuth *auth
);
Gets the authentication service ID.
gs_auth_get_provider_name ()
const gchar *
gs_auth_get_provider_name (GsAuth *auth
);
Gets the authentication service name.
gs_auth_set_provider_name ()
void gs_auth_set_provider_name (GsAuth *auth
,const gchar *provider_name
);
Sets the name to be used for the authentication dialog.
gs_auth_get_provider_logo ()
const gchar *
gs_auth_get_provider_logo (GsAuth *auth
);
Gets the authentication service image.
gs_auth_set_provider_logo ()
void gs_auth_set_provider_logo (GsAuth *auth
,const gchar *provider_logo
);
Sets the image to be used for the authentication dialog.
gs_auth_get_provider_uri ()
const gchar *
gs_auth_get_provider_uri (GsAuth *auth
);
Gets the authentication service website.
gs_auth_set_provider_uri ()
void gs_auth_set_provider_uri (GsAuth *auth
,const gchar *provider_uri
);
Sets the website to be used for the authentication dialog.
gs_auth_get_provider_schema ()
const gchar *
gs_auth_get_provider_schema (GsAuth *auth
);
Gets the authentication schema ID.
gs_auth_set_provider_schema ()
void gs_auth_set_provider_schema (GsAuth *auth
,const gchar *provider_schema
);
Sets the schema ID to be used for saving the state to disk.
gs_auth_set_username ()
void gs_auth_set_username (GsAuth *auth
,const gchar *username
);
Sets the username to be used for the authentication.
gs_auth_get_password ()
const gchar *
gs_auth_get_password (GsAuth *auth
);
Gets the password to be used for the authentication.
gs_auth_set_password ()
void gs_auth_set_password (GsAuth *auth
,const gchar *password
);
Sets the password to be used for the authentication.
gs_auth_set_pin ()
void gs_auth_set_pin (GsAuth *auth
,const gchar *pin
);
Sets the 2 factor authentication PIN, which can be left unset.
gs_auth_get_flags ()
GsAuthFlags
gs_auth_get_flags (GsAuth *auth
);
Gets any flags set on the authentication, for example if we should remember credentials.
gs_auth_set_flags ()
void gs_auth_set_flags (GsAuth *auth
,GsAuthFlags flags
);
Gets any flags set on the authentication.
gs_auth_add_flags ()
void gs_auth_add_flags (GsAuth *auth
,GsAuthFlags flags
);
Adds flags to an existing authentication without replacing the other flags.
gs_auth_has_flag ()
gboolean gs_auth_has_flag (GsAuth *auth
,GsAuthFlags flags
);
Finds ouf if the authentication has a flag.
gs_auth_get_metadata_item ()
const gchar * gs_auth_get_metadata_item (GsAuth *auth
,const gchar *key
);
Gets some metadata from a authentication object. It is left for the the plugin to use this method as required, but a typical use would be to retrieve some secure auth token.
gs_auth_add_metadata ()
void gs_auth_add_metadata (GsAuth *auth
,const gchar *key
,const gchar *value
);
Adds metadata to the authentication object. It is left for the the plugin to use this method as required, but a typical use would be to store some secure auth token.
gs_auth_store_load ()
gboolean gs_auth_store_load (GsAuth *auth
,GsAuthStoreFlags flags
,GCancellable *cancellable
,GError **error
);
Loads authentication tokens from disk in a secure way. By default only the username and password are loaded, but they are not overwritten if already set.
If additional tokens are required to be loaded you must first tell the
GsAuth instance what metadata to load. This can be done using:
gs_auth_add_metadata("additional-secret-key-name",NULL)
This function is expected to be called from gs_plugin_setup()
.
Parameters
auth |
a GsAuth |
|
flags |
some GsAuthStoreFlags, e.g. |
|
cancellable |
a GCancellable or |
|
error |
gs_auth_store_save ()
gboolean gs_auth_store_save (GsAuth *auth
,GsAuthStoreFlags flags
,GCancellable *cancellable
,GError **error
);
Saves the username, password and all added metadata to disk in a secure way.
This function is expected to be called from gs_plugin_setup()
.
Parameters
auth |
a GsAuth |
|
flags |
some GsAuthStoreFlags, e.g. |
|
cancellable |
a GCancellable or |
|
error |