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

Mailing List Archive: Catalyst: Users

Authorisation

 

 

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


ivan.wills at gmail

May 19, 2009, 3:21 AM

Post #1 of 7 (567 views)
Permalink
Authorisation

i,

I have been trying to set up the catalyst Authorization plugin I have my
Model in a module called DietDB and in my application module I have the
Authorization set up as:

authentication => {
default_realm => 'people',
realms => {
people => {
credential => {
class => 'Person',
password_field => 'person_password',
password_type => 'clear'
},
store => {
class => 'DBIx::Class',
user_model => 'DietDB',
role_relation => 'role',
role_field => 'role_name',
}
}
}
},

When my login controller calls $c->authenticate({username => $username,
password => $password}) I get the error message:

Caught exception in Diet::Controller::Login->index
"$c->model('DB::Users') did not return a resultset. Did you set
user_model correctly? at
/usr/local/share/perl/5.10.0/Catalyst/Authentication/Store/DBIx/Class.pm
line 61"

Have I missed a configuration option? I am using Catalyst 5.80003 and other
code is successfully calling $c->model('DietDB').

Thanks,
Ivan

--
email/jabber: ivan.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


ben-catalyst at vinnerd

May 19, 2009, 3:32 AM

Post #2 of 7 (551 views)
Permalink
Re: Authorisation [In reply to]

Ivan Wills wrote:
> user_model => 'DietDB',
>
Change this to:

user_model => 'DietDB::User'


(replace User with whatever you User table is called).

Ben


_______________________________________________
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/


ivan.wills at gmail

May 19, 2009, 4:24 AM

Post #3 of 7 (554 views)
Permalink
Re: Authorisation [In reply to]

I tried that but still get the same error. It looks like the user_model is
not being picked up by Catalyst::Authentication::Store::DBIx::Class. I also
tried getting Catalyst::Runtime 5.80004 but that hasn't helped.

Ivan

2009/5/19 Ben Vinnerd <ben-catalyst[at]vinnerd.com>

> Ivan Wills wrote:
>
>> user_model => 'DietDB',
>>
>> Change this to:
>
> user_model => 'DietDB::User'
>
>
> (replace User with whatever you User table is called).
>
> Ben
>
>
> _______________________________________________
> 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/
>



--
email/jabber: ivan.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


jshirley at gmail

May 19, 2009, 7:07 AM

Post #4 of 7 (548 views)
Permalink
Re: Authorisation [In reply to]

On Tue, May 19, 2009 at 8:24 PM, Ivan Wills <ivan.wills[at]gmail.com> wrote:

> I tried that but still get the same error. It looks like the user_model is
> not being picked up by Catalyst::Authentication::Store::DBIx::Class. I also
> tried getting Catalyst::Runtime 5.80004 but that hasn't helped.
>
> Ivan
>
>
I think there are a few problems... one, the documentation for
Catalyst::Authentication::Store::DBIx::Class uses the deprecated
'authentication' configuration key. If you have something else that uses
the current 'Plugin::Authentication' key that will take precedence (and I'm
not sure if they're merged).

So, make sure that all your config for authentication uses the
'Plugin::Authentication' key (__PACKAGE__->config( 'Plugin::Authentication'
=> { ... } ) and then move to #2:

Something else is setting user_model to DB::User -- as the original error
message indicates that is the resultset being requested from configuration.


Do a grep through your config for "user_model" and also run a request with
?dump_info=1 appended to get the forced Debug screen. While running the
server under debug mode, just http://localhost:3000/?dump_info=1 should be
sufficient. The ?dump_info=1 technique will only work on actions that find
their way to ActionClass('RenderView'), if you are using REST or a custom
end action you may not get the debug screen.

The ?dump_info will get your config the way Catalyst sees it, which is
better than what you may guess it is ;)

-J


ivan.wills at gmail

May 19, 2009, 10:19 AM

Post #5 of 7 (547 views)
Permalink
Re: Authorisation [In reply to]

2009/5/20 J. Shirley <jshirley[at]gmail.com>

> On Tue, May 19, 2009 at 8:24 PM, Ivan Wills <ivan.wills[at]gmail.com> wrote:
>
>> I tried that but still get the same error. It looks like the user_model is
>> not being picked up by Catalyst::Authentication::Store::DBIx::Class. I also
>> tried getting Catalyst::Runtime 5.80004 but that hasn't helped.
>>
>> Ivan
>>
>>
> I think there are a few problems... one, the documentation for
> Catalyst::Authentication::Store::DBIx::Class uses the deprecated
> 'authentication' configuration key. If you have something else that uses
> the current 'Plugin::Authentication' key that will take precedence (and I'm
> not sure if they're merged).
>
> So, make sure that all your config for authentication uses the
> 'Plugin::Authentication' key (__PACKAGE__->config( 'Plugin::Authentication'
> => { ... } ) and then move to #2:
>
> Something else is setting user_model to DB::User -- as the original error
> message indicates that is the resultset being requested from configuration.
>
>
> Do a grep through your config for "user_model" and also run a request with
> ?dump_info=1 appended to get the forced Debug screen. While running the
> server under debug mode, just http://localhost:3000/?dump_info=1 should be
> sufficient. The ?dump_info=1 technique will only work on actions that find
> their way to ActionClass('RenderView'), if you are using REST or a custom
> end action you may not get the debug screen.
>
> The ?dump_info will get your config the way Catalyst sees it, which is
> better than what you may guess it is ;)
>
> -J
>
>
> _______________________________________________
> 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/
>
>
Thanks I did have a 'Plugin::Authentication' => {...} line, fixing that got
rid of the spurious DB::User error.

--
email/jabber: ivan.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


bobtfish at bobtfish

May 19, 2009, 11:22 AM

Post #6 of 7 (547 views)
Permalink
Re: Authorisation [In reply to]

On 19 May 2009, at 18:19, Ivan Wills wrote:
>
> Thanks I did have a 'Plugin::Authentication' => {...} line, fixing
> that got rid of the spurious DB::User error.

By 'fixing that' you mean moving all your config out of the
'authentication' key, and into the 'Plugin::Authentication' key, not
the other way round, right?

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/


ivan.wills at gmail

May 20, 2009, 6:15 PM

Post #7 of 7 (506 views)
Permalink
Re: Authorisation [In reply to]

2009/5/20 Tomas Doran <bobtfish[at]bobtfish.net>

>
> On 19 May 2009, at 18:19, Ivan Wills wrote:
>
>>
>> Thanks I did have a 'Plugin::Authentication' => {...} line, fixing that
>> got rid of the spurious DB::User error.
>>
>
> By 'fixing that' you mean moving all your config out of the
> 'authentication' key, and into the 'Plugin::Authentication' key, not the
> other way round, right?
>
> Cheers
> t0m


Yep

Ivan

--
email/jabber: ivan.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |

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.