FAQ
All rejoice 1.0 of C::P::Auth::Simple is on the CPAN.
There is a remarkable similarity between this & the other two C::P::Auth
modules already on the CPAN, go figure.
Mark
From the README:
Catalyst-Plugin-Authentication-Simple version 1.0
=================================================

A 'simple' authentication mechanism for Catalyst.
Usernames, passwords, & roles come from either a file or an array ref.

In your Catalyst main module say something like:

MyCatalystObject->config(
....
authentication => {
user_file => '/full/path/to/user/file',
[ password_hash => 'md5' OR 'sha' ]
},


The format of 'user_file' is:

<user1>:<pass1>:<role1>,<role2>,<role3>
<user2>:<pass2>:<role2>,<role4>
<user3>:<pass3>:<role1>,<role3>,<role4>
...

Instead of 'user_file' you can pass in an array ref like:

authentication => {
users => [
'<user1>:<pass1>:<role1>,<role2>,<role3>',
'<user2>:<pass2>:<role2>,<role4>',
'<user3>:<pass3>:<role1>,<role3>,<role4>.
],
[ password_hash => 'md5' OR 'sha' ]


IF 'password_hash' is set to md5 or sha the password is a hash of one of
those two variants, so the $password you pass into 'login' or
'session_login' will be hashed by Digest::MD5::md5_hex or
Digest::SHA::sha1_hex & then checked for equality.

Final thing - if you pass in a filename the username list will be read in
once & only once & then converted to the 'users' array ref. Later in your
app you can dynamically change this array ref. as you please for future
login attempts...

Have Fun!

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJul 27, '05 at 2:13a
activeJul 27, '05 at 2:13a
posts1
users1
websitecatalystframework.org
irc#catalyst

1 user in discussion

Mark Ethan Trostler: 1 post

People

Translate

site design / logo © 2021 Grokbase