FAQ
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@gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090519/62245449/attachment.htm

Search Discussions

  • Ben Vinnerd at May 19, 2009 at 10:32 am

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

    user_model => 'DietDB::User'


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

    Ben
  • Ivan Wills at May 19, 2009 at 11:24 am
    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@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@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/


    --
    email/jabber: ivan.wills@gmail.com
    /
    / _ _
    / \ / | | | |
    / \/ \_| | |
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090519/653cdcb9/attachment.htm
  • Jay Shirley at May 19, 2009 at 2:07 pm

    On Tue, May 19, 2009 at 8:24 PM, Ivan Wills 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
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090519/5fdd81ce/attachment.htm
  • Ivan Wills at May 19, 2009 at 5:19 pm
    2009/5/20 J. Shirley <jshirley@gmail.com>
    On Tue, May 19, 2009 at 8:24 PM, Ivan Wills 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@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@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@gmail.com
    /
    / _ _
    / \ / | | | |
    / \/ \_| | |
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090520/1ab6699f/attachment.htm
  • Tomas Doran at May 19, 2009 at 6:22 pm

    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
  • Ivan Wills at May 21, 2009 at 1:15 am
    2009/5/20 Tomas Doran <bobtfish@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@gmail.com
    /
    / _ _
    / \ / | | | |
    / \/ \_| | |
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090521/0c81c566/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMay 19, '09 at 10:21a
activeMay 21, '09 at 1:15a
posts7
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase