Top | ![]() |
![]() |
![]() |
![]() |
SnapdAuthData * | snapd_login_sync () |
void | snapd_login_async () |
SnapdAuthData * | snapd_login_finish () |
To allow non-root users to authorize with snapd as D-Bus service called
snapd-login-service is provided. This service uses Polkit to allow privileded
users to install and remove snaps. snapd_login_sync()
calls this service to
get a SnapdAuthData that can be passed to a snapd client with
snapd_client_set_auth_data()
.
SnapdAuthData * snapd_login_sync (const gchar *username
,const gchar *password
,const gchar *otp
,GCancellable *cancellable
,GError **error
);
Log in to snapd and get authorization to install/remove snaps.
This call contacts the snapd-login-service that will authenticate the user
using Polkit and contact snapd on their behalf.
If you are root, you can get this authentication directly from snapd using
snapd_client_login_sync()
.
void snapd_login_async (const gchar *username
,const gchar *password
,const gchar *otp
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get authorization to install/remove snaps.
See snapd_login_sync()
for more information.
username |
usename to log in with. |
|
password |
password to log in with. |
|
otp |
response to one-time password challenge. |
[allow-none] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
SnapdAuthData * snapd_login_finish (GAsyncResult *result
,GError **error
);
Complete login started with snapd_login_async()
.
See snapd_login_sync()
for more information.