The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dancer2::Plugin::Auth::Extensible::Role::Provider - base role for authentication providers

DESCRIPTION

Base Moo::Role for authentication providers.

Also provides secure password matching which automatically handles crypted passwords via Crypt::SaltedHash.

ATTRIBUTES

plugin

The calling Dancer2::Plugin::Auth::Extensible object.

Required.

disable_roles

Defaults to the value of "disable_roles" in Dancer2::Plugin::Auth::Extensible.

encryption_algorithm

The encryption_algorithm used by "encrypt_password".

Defaults to 'SHA-1';

METHODS

match_password $given, $correct

Matches $given password with the $correct one.

encrypt_password $password

Encrypts password $password with "encryption_algorithm" and returns the encrypted password.

METHODS IMPLEMENTED BY PROVIDER

The following methods must be implemented by the consuming provider class.

required methods

  • authenticate_user

  • get_user_details

  • get_user_roles

optional methods

The following methods are optional and extend the functionality of the provider.

  • set_user_details

  • set_user_password

  • password_expired