Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Plugin::Authentication apparently not reading config

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


jmac at jmac

Jun 4, 2009, 8:26 PM

Post #1 of 3 (344 views)
Permalink
Plugin::Authentication apparently not reading config

Howdy all,

I'm quite perplexed about some behavior from Plugin::Authentication.
I'm trying to get a Catalyst app running on a new machine, but
Authentication isn't reading any realms from my config. The config
file is definitely getting read otherwise, and I can see my
authentication realms definition sitting there in the "Config" session
of Catalyst's in-browser error screen while I'm trying to debug this,
but as far as I can tell the Auth module just isn't reading it.

I'm debugging with this line:

use Data::Dumper; die Dumper ( $c->auth_realms );

On the original machine, this prints a nice, full hashref containing
all my realms info. On the new machine, this prints {}. So, the
Authentication plugin is loading (and giving $c the auth_realms
method), but it's not reading my config at all, apparently.

This is the config I'm feeding it (exact same code in both machines):

__PACKAGE__->config->{'Plugin::Authentication'} =
{
default_realm => 'members',
members => {
credential => {
class => 'Password',
password_field => 'password',
password_type => 'clear',
},
store => {
class => 'DBIx::Class',
user_class => 'NEADB::User',
id_field => 'id',
}
}
};

Even if I paste in the example config from Plugin::Authentication's
man page, the return value of $c->auth_realms is still an empty
hashref.

As far as I can tell, the version numbers of all modules involved
match. (Using latest CPAN or Debian versions of all modules.)

Any advice as to where to look next would be enormously appreciated.

--
Jason McIntosh
Appleseed Software Consulting
http://appleseed-sc.com

Email: jmac[at]appleseed-sc.com
Jabber: jmac[at]appleseed-sc.com
AIM: zendonut
Cell: 617-792-3829

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

Jun 5, 2009, 3:56 AM

Post #2 of 3 (306 views)
Permalink
Re: Plugin::Authentication apparently not reading config [In reply to]

Jason McIntosh wrote:
> As far as I can tell, the version numbers of all modules involved
> match. (Using latest CPAN or Debian versions of all modules.)
>
> Any advice as to where to look next would be enormously appreciated.

My only real suggestion is to throw some dumping / debugging into the
_authentication_initialize routine of Catalyst/Plugin/Authentication.pm

to work out how/why it isn't finding your realms hash..

Also, does the config printed in the debug screen match what you expect
for auth config, or does it look incorrect in any way?

Cheers
t0m

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


jmac at jmac

Jun 5, 2009, 7:11 AM

Post #3 of 3 (306 views)
Permalink
Re: Plugin::Authentication apparently not reading config [In reply to]

On Fri, Jun 5, 2009 at 6:56 AM, Tomas Doran<bobtfish[at]bobtfish.net> wrote:
>
> My only real suggestion is to throw some dumping / debugging into the
> _authentication_initialize routine of Catalyst/Plugin/Authentication.pm
> to work out how/why it isn't finding your realms hash..

Thank you, this was the nudge I needed.

My problem was that the call to setup() had somehow wandered too high
up in my application's main module code, so that it was getting called
too early. No idea _how_ that happened, but it all makes sense from
there.

--
Jason McIntosh
Appleseed Software Consulting
http://appleseed-sc.com

Email: jmac[at]appleseed-sc.com
Jabber: jmac[at]appleseed-sc.com
AIM: zendonut
Cell: 617-792-3829

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.