[Catalyst] Maintenance release: C::P::Authentication

marcus baker marcus.baker at gmail.com
Mon Jul 23 19:52:41 GMT 2007


Is it possible that the latest C::P::Authentication updates are also
affecting Catalyst::Plugin::Authentication::Store::DBIx::Class?  Using the
recent modules (including Catalyst-Plugin-Authentication-0.10002 which I'm
assuming is this maintenance release) I'm continuing to get the following
error when I try running the authenticate() method, passing in a username
and password in a hashref:

Caught exception in (App)::Controller::Root->login "Can't use string
("(App)::Model::DBIC::User") as a HASH ref while "strict refs" in use at
/usr/local/share/perl/5.8.7/Class/Accessor/Grouped.pm line 251."

(App) being my application's package name, and my authentication /
authorization configuration as follows:

                     authentication =3D> {
                         default_realm =3D> 'users',
                         realms =3D> {
                             users =3D> {
                                 credential =3D> {
                                     class =3D> 'Password',
                                     password_field =3D> 'password',
                                     password_type =3D> 'hashed',
                                     password_hash_type =3D> 'SHA-1',
                                 },
                                 store =3D> {
                                     class =3D> 'DBIx::Class',
                                     user_field =3D> 'username',
                                     user_class =3D> 'DBIC::User',
                                     role_relation =3D> 'user_roles',
                                     role_field =3D> 'role'
                                 },
                             },
                         },
                     },
                      authorization =3D> {
                         dbic =3D> {
                             role_class =3D> 'DBIC::Role',
                             role_field =3D> 'role',
                             role_rel =3D> 'user_roles',
                             user_role_user_field =3D> 'user',
                        }
                     },

The related plugins loaded are:  Authentication (0.10002),
Authentication::Credential::Password (?), Authorization::Roles (0.05), and
Authorization::ACL (0.08)

Class::Accessor::Grouped (0.07000)
DBIx::Class (0.08003)

Thanks
-Marcus

2007/7/21, Jay K <jayk at ion0.com>:
>
> Hey all,
>
> Turns out there was a minor bug in C::P::Authentication - this didn't
> affect updated modules, but it did limit the compatibility of older
> modules with the new Auth.
>
> I've uploaded a maintenance release to CPAN which fixes this bug.
> I should also note that after fixing this bug, the LDAP module is now
> fully compatible with realms (with a slightly different config)
>
> Basically - you avoid placing the LDAP store in the 'use Catalyst'
> line and instead configure auth as follows:
>
> > __PACKAGE__->config(
> >         authentication =3D> {
> >             default_realm =3D> 'users',
> >             realms =3D> {
> >                 users =3D> {
> >                     credential =3D> {
> >                         class =3D> 'Password',
> >                         password_field =3D> 'password',
> >                         password_type =3D> 'self_check',
> >                     },
> >                     store =3D> {
> >                         class =3D> 'LDAP::Backend',
> >                           [ ... rest of LDAP config ]
> >                       }
> >                   }
> >               }
> >           }
> >       );
>
> Then just replace your $c->login call with $c->authenticate, as follows:
>
> > old:
> >
> > $c->login($username, $password);
> >
> > new:
> >
> > $c->authenticate({ id =3D> $username, password =3D> $password });
>
> I post this because this may work with other 'old-style' modules too
> - and is worth trying as an initial step towards migrating to realms.
>
> Anyway - thanks to Wade (aka waswas) for helping track this problem
> down.
>
> JayK
>
>
>
> ---
> For most things, throwing yourself at the wall over and over is a
> better way to improve than thinking hard about the wall and taking
> pictures of it.  -- D.Litwack
>
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070723/a5ee7=
b60/attachment-0001.htm


More information about the Catalyst mailing list