views:

307

answers:

2

I am trying to use Class::DBI with Catalyst::Plugin::Authentication::Store::DBIC. The example given on CPAN does not work with Class::DBI. For example, the config is incorrect: role_class => 'DB::Role' has to be replaced by role_class => 'MyApp::Model::DB::Role' I got Authentication working using plain DBI, but I would rather use Class::DBI like in the rest of my application.

I could not find a complete example of Catalyst authentication with Class:DBI. Do you know any such tutorial?

+2  A: 

I suspect you'd be better off asking about this on the #catalyst channel on irc.perl.org. You'll either end up writing your own store for CDBI, or you'll work out how to use the CDBI compatibility layer in DBIx::Class to get it working, or if it's a new codebase, then you should really consider CDBI legacy and build your schema with DBIx::Class and DBIx::Class::Schema::Loader

singingfish
+1  A: 

I hate to say it, but singingfish is right. The Catalyst::Plugin::Authentication::Store::DBIC has not been updated in some time (aside from being made to display the deprecated warning) It also uses the old (2006) authentication API and will be the limiting factor of your application even if you did get it to work.

If you have the option, I would switch to DBIx::Class. If not, your only real choice is to write your own user storage module that works with Class::DBI. It's actually not too hard and you can find instructions in the internals doc for Catalyst Auth:

http://search.cpan.org/dist/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication/Internals.pod

Good luck!

JayK

jayk