PlugAuth::Role::Auth - Role for PlugAuth authentication plugins
version 0.17
package PlugAuth::Plugin::MyAuth; use Role::Tiny::With; with 'PlugAuth::Role::Plugin'; with 'PlugAuth::Role::Auth'; # accept user = larry and pass = wall only. sub check_credentials { my($self, $user, $pass) = @_; return 1 if $user eq 'larry' && $pass eq 'wall'; return $self->deligate_check_credentials($user, $pass); } # only one user, larry sub all_users { qw( larry ) } 1;
Use this role when writing PlugAuth plugins that manage authentication (ie. determine the identify of the user).
These methods must be implemented by your class.
Return 1 if the password is correct for the given user.
Return 0 otherwise.
These methods may be implemented by your class.
Returns the list of all users known to your plugin. If this cannot be determined, then return an empty list.
Create the given user with the given password. Return 1 on success, return 0 on failure.
Change the password of the given user. Return 1 on success, return 0 on failure.
Delete the given user. Return 1 on success, return 0 on failure.
Returns the next authentication plugin. May be undef if there is no next authentication plugin.
Delegate to the next authentication plugin. Call this method if your plugins authentication has failed if your plugin is not authoritative.
PlugAuth, PlugAuth::Guide::Plugin, Test::PlugAuth::Plugin::Auth
Graham Ollis <gollis@sesda3.com>
This software is copyright (c) 2012 by NASA GSFC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install PlugAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PlugAuth
CPAN shell
perl -MCPAN -e shell install PlugAuth
For more information on module installation, please visit the detailed CPAN module installation guide.