Class

AstalAuthPam

since: 0.1

Description

final class AstalAuth.Pam : GObject.Object
{
  /* No available fields */
}

For simple authentication using only a password, using the astal_auth_pam_authenticate() method is recommended. Look at the simple examples for how to use it.

There is also a way to get access to the pam conversation, to allow for a more complex authentication process, like using multiple factor authentication. Generally it can be used like this:

  1. create the Pam object.
  2. set username and service if so required. It has sane defaults, so in most cases you can skip this.
  3. connect to the signals. After an auth-* signal is emitted, it has to be responded with exactly one astal_auth_pam_supply_secret() call. The secret is a string containing the user input. For auth-info and auth-error it should be NULL. Not connecting those signals, is equivalent to calling astal_auth_pam_supply_secret() with NULL immediately after the signal is emitted.
  4. start authentication process using astal_auth_pam_start_authenticate().
  5. it is possible to reuse the same Pam object for multiple sequential authentication attempts. Just call astal_auth_pam_start_authenticate() again after the success or fail signal was emitted.

Available since: 0.1

Ancestors

Functions

astal_auth_pam_authenticate

Requests authentication of the provided password using the PAM (Pluggable Authentication Modules) system.

since: 0.1

astal_auth_pam_authenticate_finish
No description available.

since: 0.1

Instance methods

astal_auth_pam_get_service

Fetches the service from AsalAuthPam object.

since: 0.1

astal_auth_pam_get_username

Fetches the username from AsalAuthPam object.

since: 0.1

astal_auth_pam_set_service

Sets the service to be used for authentication. This must be set to before calling start_authenticate. Changing it afterwards has no effect on the authentication process.

since: 0.1

astal_auth_pam_set_username

Sets the username to be used for authentication. This must be set to before calling start_authenticate. Changing it afterwards has no effect on the authentication process.

since: 0.1

astal_auth_pam_start_authenticate

Starts a new authentication process using the PAM (Pluggable Authentication Modules) system. Note that this will cancel an already running authentication process associated with this AstalAuthPam object.

since: 0.1

astal_auth_pam_supply_secret

Provides pam with a secret. This method must be called exactly once after a auth-* signal is emitted.

since: 0.1

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

AstalAuth.Pam:service

The pam service used for authentication. Changing the value of this property has no affect on an already started authentication process.

since: 0.1

AstalAuth.Pam:username

The username used for authentication. Changing the value of this property has no affect on an already started authentication process.

since: 0.1

Signals

AstalAuth.Pam::auth-error

This signal is emitted when an authentication error has occured.

since: 0.1

AstalAuth.Pam::auth-info

This signal is emitted when the user should receive an information (e.g., tell the user to touch a security key, or the remaining time pam has been locked after multiple failed attempts)

since: 0.1

AstalAuth.Pam::auth-prompt-hidden

This signal is emitted when user input is required. The input should be hidden when entered (e.g., for passwords).

since: 0.1

AstalAuth.Pam::auth-prompt-visible

This signal is emitted when user input is required. The input should be visible when entered (e.g., for One-Time Passwords (OTP)).

since: 0.1

AstalAuth.Pam::fail

This signal is emitted when authentication failed.

since: 0.1

AstalAuth.Pam::success

This signal is emitted after successful authentication.

since: 0.1

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

unstable since: 2.0

Class structure

struct AstalAuthPamClass {
  GObjectClass parent_class;
  
}
No description available.
Class members
parent_class: GObjectClass
No description available.