Catalyst::Authentication::Store::Htpasswd - Authen::Htpasswd based user storage/authentication
version 1.006
use Catalyst qw/ Authentication /; __PACKAGE__->config( authentication => { default_realm => 'test', realms => { test => { credential => { class => 'Password', password_field => 'password', password_type => 'self_check', }, store => { class => 'Htpasswd', file => 'htpasswd', }, }, }, }, ); sub login : Global { my ( $self, $c ) = @_; $c->authenticate({ username => $c->req->param("login"), password => $c->req->param("password") }); }
This plugin uses Authen::Htpasswd to let your application use .htpasswd files for it's authentication storage.
.htpasswd
Simple constructor, dies if the htpassword file can't be found
Looks up the user, and returns a Catalyst::Authentication::Store::Htpasswd::User object.
Delegates to Catalyst::Authentication::User->supports or an override in user_class.
Delegates the user lookup to find_user
The path to the htpasswd file. If the path starts with a slash, then it is assumed to be a fully qualified path, otherwise the path is fed through $c->path_to and so normalised to the application root.
$c->path_to
Alternatively, it is possible to pass in an Authen::Htpasswd object here, and this will be used as the htpasswd file.
Change the user class which this store returns. Defaults to Catalyst::Authentication::Store::Htpasswd::User. This can be used to add additional functionality to the user class by sub-classing it, but will not normally be needed.
Change the field that the username is found in in the information passed into the call to $c->authenticate().
$c->authenticate()
This defaults to username , and generally you should be able to use the module as shown in the synopsis, however if you need a different field name then this setting can change the default.
Example:
__PACKAGE__->config( authentication => { realms => { test => { store => { class => 'Htpasswd', user_field => 'email_address', }, }}}); # Later in your code $c->authenticate({ email_address => $c->req->param("email"), password => $c->req->param("password") });
Authen::Htpasswd.
Bugs may be submitted through the RT bug tracker (or bug-Catalyst-Authentication-Store-Htpasswd@rt.cpan.org).
There is also a mailing list available for users of this distribution, at http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst.
There is also an irc channel available for users of this distribution, at #catalyst on irc.perl.org.
#catalyst
irc.perl.org
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
David Kamholz <dkamholz@cpan.org>
Tomas Doran <bobtfish@bobtfish.net>
Karen Etheridge <ether@cpan.org>
Tom Bloor <t.bloor@shadowcat.co.uk>
Christopher Hoskin <christopher.hoskin@gmail.com>
Ilmari Vacklin <ilmari.vacklin@cs.helsinki.fi>
This software is copyright (c) 2005 by יובל קוג'מן (Yuval Kogman).
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 Catalyst::Authentication::Store::Htpasswd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Authentication::Store::Htpasswd
CPAN shell
perl -MCPAN -e shell install Catalyst::Authentication::Store::Htpasswd
For more information on module installation, please visit the detailed CPAN module installation guide.