[Catalyst] Catalyst::Plugin::Authentication w/ multiple stores

Hermida, Leandro Leandro.Hermida at fmi.ch
Fri Dec 22 16:49:57 GMT 2006


> From: Hermida, Leandro [mailto:Leandro.Hermida at fmi.ch] 
> Sent: Friday, December 22, 2006 17:38
> Subject: [Catalyst] Catalyst::Plugin::Authentication w/ 
> multiple stores
> 
> 
> Hi everyone,
> 
> Does anyone know how to configure 
> Catalyst::Plugin::Authentication with multiple stores?  The 
> docs are very ambiguous on this and when I follow them as 
> best I can it doesn't work.  I use C::P::A::Store::LDAP as my 
> first store and try to authenticate users with that but I 
> would like Catalyst to also try a secondary store, 
> C::P::A::Store::DBIC, if the user doesn't exist in the LDAP tree.
> 
> Am I misunderstanding C::P::A's feature of being able to use 
> multiple stores?
> 
> In MyApp.pm:
> 
> use Catalyst qw/
>     -Debug
>     ConfigLoader
>     Static::Simple
>     StackTrace
>     Authentication
>     Authentication::Store::LDAP
>     Authentication::Store::DBIC
>     Authentication::Credential::Password
>     Authorization::Roles
>     Authorization::ACL
>     Session
>     Session::Store::FastMmap
>     Session::State::Cookie
> /;
> 
> In myapp.yml:
> 
> authentication:
>     store: Catalyst::Plugin::Authentication::Store::LDAP
>     stores:
>         ldap: Catalyst::Plugin::Authentication::Store::LDAP
>         dbic: Catalyst::Plugin::Authentication::Store::DBIC
>     ldap:
>         ldap_server: pdc.domain.com
>         ldap_server_options:
>             version: 3
>         binddn: cn=adsearchuser,cn=Users,dc=domain,dc=com
>         bindpw: adsearchpassword
>         user_basedn: cn=Users,dc=domain,dc=com
>         user_scope: sub
>         user_filter: (&(objectclass=user)(samaccountname=%s))
>         user_field: samaccountname
>     dbic:
>         user_class: Schema::User
>         user_field: username
>         password_field: password
>         password_type: hashed
>         password_hash_type: SHA-1
> 
> Is there something incorrect here?
> 
> Thanks,
> 
> Leandro

I also found something broken with Catalyst::Plugin::Authentication.
If, instead of how I do it above, I specify the C::P::A::Store::DBIC
first in MyApp.pm:

use Catalyst qw/
    -Debug
    ConfigLoader
    Static::Simple
    StackTrace
    Authentication
    Authentication::Store::DBIC
    Authentication::Store::LDAP
    Authentication::Credential::Password
    Authorization::Roles
    Authorization::ACL
    Session
    Session::Store::FastMmap
    Session::State::Cookie
/;

Then the application will not run and I get the error:

You must provide a user_class at
/usr/lib/perl5/site_perl/5.8.5/Catalyst.pm line 880
Compilation failed in require at web/script/mimas_web_server.pl line 53.

But I do have user_class defined for DBIC in myapp.yml.

Leandro




More information about the Catalyst mailing list