AuthShield v0.0.1 AuthShield.Authentication View Source
Implements a set of functions to deal with authentication requests.
Authentication is the process of determining whether someone or something is, in fact, who or what it declares itself to be, in other word it's the action of check if the user's credentials match the credentials in a database of authorized users or in a data authentication server.
Link to this section Summary
Types
Authentication possible responses
Functions
Authenticates the user by password credential.
Authenticates the user by PIN credential.
Authenticates the user by TOTP credential.
Link to this section Types
responses()
View Sourceresponses() :: {:ok, :authenticated} | {:error, :unauthenticated}
Authentication possible responses
Link to this section Functions
authenticate_password(user, pass_code)
View Sourceauthenticate_password( user :: AuthShield.Resources.Schemas.User.t(), pass_code :: String.t() ) :: responses()
Authenticates the user by password credential.
If the user is active and the password credentials are right it
will return {:ok, :authenticated}
otherwiese {:error, :unauthorized}
.
Exemples:
AuthShield.Authentication.authenticate_password(user, "Mypass@rd23")
authenticate_pin(user, pin_code)
View Sourceauthenticate_pin( user :: AuthShield.Resources.Schemas.User.t(), pin_code :: String.t() ) :: responses()
Authenticates the user by PIN credential.
If the user is active and the password credentials are right it
will return {:ok, :authenticated}
otherwiese {:error, :unauthorized}
.
Exemples:
AuthShield.Authentication.authenticate_pin(user, "332145")
authenticate_totp(user, totp_code)
View Sourceauthenticate_totp( user :: AuthShield.Resources.Schemas.User.t(), totp_code :: String.t() ) :: responses()
Authenticates the user by TOTP credential.
If the user is active and the password credentials are right it
will return {:ok, :authenticated}
otherwiese {:error, :unauthorized}
.
Exemples:
AuthShield.Authentication.authenticate_totp(user, "332145")