- METHODS IMPLEMENTED BY PROVIDER
Dancer2::Plugin::Auth::Extensible::Role::Provider - base role for authentication providers
Base Moo::Role for authentication providers.
Also provides secure password matching which automatically handles crypted passwords via Crypt::SaltedHash.
The calling Dancer2::Plugin::Auth::Extensible object.
Defaults to the value of "disable_roles" in Dancer2::Plugin::Auth::Extensible.
The encryption_algorithm used by "encrypt_password".
Defaults to 'SHA-512';
$given password with the
$password with "encryption_algorithm" and returns the encrypted password.
The following methods must be implemented by the consuming provider class.
authenticate_user $username, $password
If either of
$passwordare undefined then die.
Return true on success.
The following methods are optional and extend the functionality of the provider.
$usernameis undefined. Otherwise return a user object (if appropriate) or a hash reference of user details.
$usernameis undefined. Otherwise return an array reference of user roles.
Create user with fields specified in
Method should croak if
usernamekey is empty or undefined. If a user with the specified username already exists then we would normally expect the method to die though this is of course dependent on the backend in use.
The new user should be returned.
Try to find a user which has
pw_reset_codefield set to
Returns the user on success.
set_user_details $username, %update
Update user with
Passing an empty or undefined
$usernameshould cause the method to die.
The update user should be returned.
set_user_password $username, $password
Set the password for the user specified by
$usernameto <$password> encrypted using "encrypt_password" or via whatever other method is appropriate for the backend.
$usershould be as returned from "get_user_details". The method checks whether the user's password has expired and returns 1 if it has and 0 if it has not.