The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Plugin::Authentication::Simple

    $c->login( $user, $password );
    $c->logout;
    $c->session_login( $user, $password );
    $c->session_logout;

DESCRIPTION

Note that this plugin requires a session plugin like Catalyst::Plugin::Session::FastMmap.

METHODS

login

Attempt to authenticate a user. Takes username/password as arguments,

    $c->login( $user, $password );

User remains authenticated until end of request.

    Format of user_file:
    <username1>:<password1>:<role1>,<role2>,<role3>,...
    <username2>:<password2>:<role1>,<role2>,<role3>,...

    OR array ref of those values in 'users' key

Note: users_file will NOT get reloaded if you change it BUT you CAN change the 'users' arrayref w/o a restart...

logout

Log out the user. will not clear the session, so user will still remain logged in at next request unless session_logout is called.

process_permission

check for permissions. used by the 'roles' function.

roles

Check permissions for roles and return true or false.

    $c->roles(qw/foo bar/);

Returns an arrayref containing the verified roles.

    my @roles = @{ $c->roles };
session_login

Persistently login the user. The user will remain logged in until he clears the session himself, or session_logout is called.

    $c->session_login( $user, $password );
session_logout

Session logout. will delete the user object from the session.

EXTENDED METHODS

prepare_action

sets $c->request->{user} from session.

setup

sets up $c->config->{authentication}.

OVERLOADED METHODS

process_roles

Takes an arrayref of roles and checks if user has the supplied roles. Returns 1/0.

SEE ALSO

Catalyst. Catalyst::Plugin::Authentication::CDBI. Catalyst::Plugin::Authentication::LDAP.

AUTHOR

Mark Ethan Trostler, mark@zoo.com

COPYRIGHT

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.