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 => {
default_realm => 'users',
realms => {
users => {
credential => {
class => 'Password',
password_field => 'password',
password_type => 'hashed',
password_hash_type => 'SHA-1',
},
store => {
class => 'DBIx::Class',
user_field => 'username',
user_class => 'DBIC::User',
role_relation => 'user_roles',
role_field => 'role'
},
},
},
},
authorization => {
dbic => {
role_class => 'DBIC::Role',
role_field => 'role',
role_rel => 'user_roles',
user_role_user_field => '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 <[EMAIL PROTECTED]>:
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 => {
> default_realm => 'users',
> realms => {
> users => {
> credential => {
> class => 'Password',
> password_field => 'password',
> password_type => 'self_check',
> },
> store => {
> class => '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 => $username, password => $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: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/