Thanks Peter. That did help - I think explicitly setting the
user_class helped - even though my class is User, and the table is
user... I was setting the vars individually like:
MyApp->config{auth}{user_field} = 'email';
and maybe I was doing that wrong...
Thanks,
johnk
On 10/10/05, Peter Speltz <[EMAIL PROTECTED]> wrote:
> p.s. You do not need this at all if your classes and fields are named
> exactly like the M::P:;A:USC defaults. And if you do need it I think
> you just *need* the top 3.
>
> On 10/10/05, Peter Speltz <[EMAIL PROTECTED]> wrote:
> > Did you specify your user and passwords fields in the driver config?
> > They must mactch names on your login form. Here is my config hash for
> > auth that I have in my driver.
> >
> > # session management configuration for Authentication::UserSessionCookie
> > # and Authorization
> > BeerDB->config->{auth} = {
> > user_class => 'BeerDB::Drinker',
> > user_field => 'username',
> > password_field=> 'pw',
> >
> > # tell Authorization plugin your table names and user fk
> > role_table => 'auth_role',
> > role_assign_table => 'role_assignment',
> > permission_table => 'permission',
> > user_fk => 'usr_id',
> >
> > #cookie_expiry => '+3H',
> > cookie_name => 'cafeasp_sessionid',
> > session_class => 'Apache::Session::File', # default
> > session_args => {
> > Directory => '/usr/local/apache2/tmp/sessions', #
> > default
> > LockDirectory => '/usr/local/apache2/tmp/sessionlock', #
> > default
> > },
> > };
> >
> >
> > HTH,
> >
> > Peter
> >
> > On 10/10/05, John Krystynak <[EMAIL PROTECTED]> wrote:
> > > I'm trying to get a really simple login/auth working and M::P::A::USC
> > > isn't working for me.
> > >
> > > First: is there any sample code out there that works. Login, and
> > > logout? I'm at the point that I don't care which module it's from
> > > M::P::A::USC or
> > >
> > > Second: How do you turn on debugging? I use:
> > > use Maypole::Application qw(-Debug2 Authentication::UserSessionCookie);
> > >
> > > but I don't see the statements that should be coming from the warns in
> > > the UserSessionCookie.pm (at least they don't show up in my
> > > httpd-error.log)
> > >
> > > I must be doing something stupid - I'm trying to follow the
> > > authentication HOWTO
> > > (http://www.droogs.org/perl/maypole/authentication.html), but my app
> > > never authenticates any user. I want the debug on so I can see if it
> > > is even calling the database with the right user field.
> > >
> > > Here's my authenticate function:
> > >
> > > use Maypole::Constants;
> > > sub authenticate {
> > > my ($self, $r) = @_;
> > > $r->get_user;
> > > # let them go if they exist as a user
> > > if ($r->user) {
> > > warn "authenticate: Found user " . $r->user . "\n";
> > > return OK;
> > > }
> > >
> > > # otherwise force them to the login page
> > > warn "authenticate: " . $r->template_args->{login_error} . " :
> > > Sending to login page\n"\
> > > ;
> > >
> > > $r->{template} = "login";
> > > return OK;
> > > }
> > >
> > > The upshot is that it always goes to the login page, and r->ruser is
> > > empty, as is the login_error....
> > >
> > >
> > > Trying not to bang head too hard here...
> > >
> > > johnk
> > >
> > >
> > > --
> > > eBay vs Amazon Shopping Comparison - Try it!
> > > http://aytozon.com
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by:
> > > Power Architecture Resource Center: Free content, downloads, discussions,
> > > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > > _______________________________________________
> > > Maypole-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/maypole-users
> > >
> >
> >
> > --
> > pjs
> >
>
>
> --
> pjs
>
--
eBay vs Amazon Shopping Comparison - Try it!
http://aytozon.com
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users