Navigation: Developing Apps > BINETIX® AGE™ API > Plugins > PAM Controller > Functions
authenticate/2
Description
authenticate/2 is an Erlang function exported by "pam" module.
Authenticates a user by name and password.
References
None
Parameters
Name
Type
UserName
string()
User name or ID
Password
User password required to commence an authentication
Result
Value or Type
{success, "Success"}
{authentication_failure, Reason}
On success returns immediately {success, "Success"}
Otherwise returns atom authentication_failure with particular reason.
Code Sample
> pam:authenticate("user_1", "pass123").
> pam:authenticate("user_1", "wrong_pass").
{authentication_failure, "Authentication failure"}