Sledge::Authorizer::BasicAuth - Basic Authentication module for Sledge
package Your::Authorizer; use base qw(Sledge::Authorizer::BasicAuth); use Your::Data::User; __PACKAGE__->error_template('/401.html'); __PACKAGE__->realm('SECRET PAGE'); sub authorize { my $self = shift; my $page = shift; return if $page->session->param('user'); my ($login_id, $passwd) = $self->basic_auth($page) or return; my $user = Your::Data::User->search(login_id => $login_id, passwd => $passwd)->first; if ($user) { $page->session->param(user => $user); } else { $self->show_error_page($page); } }
Sledge::Authorizer::BasicAuth is Basic Authentication module for Sledge.
MATSUNO Tokuhiro <tokuhirom at mobilefactory.jp>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Tatsuhiko Miyagawa.
Bundle::Sledge
To install Sledge::Authorizer::BasicAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sledge::Authorizer::BasicAuth
CPAN shell
perl -MCPAN -e shell install Sledge::Authorizer::BasicAuth
For more information on module installation, please visit the detailed CPAN module installation guide.