Class
AstalAuthPam
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:
- create the Pam object.
- set username and service if so required. It has sane defaults, so in most cases you can skip this.
- connect to the signals.
After an
auth-*
signal is emitted, it has to be responded with exactly oneastal_auth_pam_supply_secret()
call. The secret is a string containing the user input. For auth-info and auth-error it should beNULL
. Not connecting those signals, is equivalent to callingastal_auth_pam_supply_secret()
withNULL
immediately after the signal is emitted. - start authentication process using
astal_auth_pam_start_authenticate()
. - it is possible to reuse the same Pam object for multiple sequential authentication attempts.
Just call
astal_auth_pam_start_authenticate()
again after thesuccess
orfail
signal was emitted.
Functions
astal_auth_pam_authenticate
Requests authentication of the provided password using the PAM (Pluggable Authentication Modules) system.
Instance methods
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.
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.
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.
astal_auth_pam_supply_secret
Provides pam with a secret. This method must be called exactly once after a auth-* signal is emitted.
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.
AstalAuth.Pam:username
The username used for authentication. Changing the value of this property has no affect on an already started authentication process.
Signals
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).
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).
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)).
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.