FAQ
I'm getting errors when I try to login to my web app, which is set up to
use the DBIC authentication plugin.



Here's the relevant portion of my config file:

authentication:
default_realm: dbic
realms:
dbic:
credential:
class: Password
password_field: usr_password
password_type: clear
store:
class: DBIx::Class
user_class: BlogDB::Users
id_field: usr_login_name



When I start the dev server, I see this:
[debug] Loaded Config "/path/to/my/config/dev.yml"
[debug] Setting up auth realm dbic



Here's the login controller:

sub login : Local {
my ($self, $c) = @_;

if ($c->request->params->{submitted} eq 'yes') {
my $username = $c->request->params->{usr_login_name} || "";
my $password = $c->request->params->{usr_password} || "";
if ($c->authenticate({ username => $username,
password => $password })) {
$c->response->redirect( $c->uri_for('/posts') );
return;
} else {
$c->stash->{message} = "Invalid user ID or password.";
}
}

$c->stash->{template} = 'users/login.tt';
$c->stash->{stylesheet} = 'form.css';
}


The login form displays fine, but when I try to log in using a
uid/password combo that IS in the database, I get this error:

[debug] "POST" request for "users/login"
[debug] Path is "users/login"
[error] Caught exception in MyApp::Controller::Users->login "User
retrieval failed: no columns from BlogDB::Users were provided at
/usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm
line 63"


I've googled for solutions until my fingertips are numb with no luck. I
suspect there's some stupid little problem that I'm missing. Can anyone
shed some light on this issue for me?

Thanks,
Greg

Search Discussions

  • Jay Shirley at Sep 24, 2008 at 11:40 pm

    On Wed, Sep 24, 2008 at 2:52 PM, Greg Coates wrote:
    I'm getting errors when I try to login to my web app, which is set up to use
    the DBIC authentication plugin.



    Here's the relevant portion of my config file:

    authentication:
    default_realm: dbic
    realms:
    dbic:
    credential:
    class: Password
    password_field: usr_password
    password_type: clear
    store:
    class: DBIx::Class
    user_class: BlogDB::Users
    id_field: usr_login_name



    When I start the dev server, I see this:
    [debug] Loaded Config "/path/to/my/config/dev.yml"
    [debug] Setting up auth realm dbic



    Here's the login controller:

    sub login : Local {
    my ($self, $c) = @_;

    if ($c->request->params->{submitted} eq 'yes') {
    my $username = $c->request->params->{usr_login_name} || "";
    my $password = $c->request->params->{usr_password} || "";
    if ($c->authenticate({ username => $username,
    password => $password })) {
    $c->response->redirect( $c->uri_for('/posts') );
    return;
    } else {
    $c->stash->{message} = "Invalid user ID or password.";
    }
    }

    $c->stash->{template} = 'users/login.tt';
    $c->stash->{stylesheet} = 'form.css';
    }


    The login form displays fine, but when I try to log in using a uid/password
    combo that IS in the database, I get this error:

    [debug] "POST" request for "users/login"
    [debug] Path is "users/login"
    [error] Caught exception in MyApp::Controller::Users->login "User retrieval
    failed: no columns from BlogDB::Users were provided at
    /usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm
    line 63"


    I've googled for solutions until my fingertips are numb with no luck. I
    suspect there's some stupid little problem that I'm missing. Can anyone
    shed some light on this issue for me?

    Thanks,
    Greg
    You probably want $c->authenticate({ usr_login_name => $username,
    usr_password => $password });

    The parameters passed into authenticate match what your DBIC schema
    class declares.

    -J
  • Greg Coates at Sep 24, 2008 at 11:50 pm
    Yep, that fixed it. I knew it had to be something simple!

    Thanks,
    Greg

    J. Shirley wrote:
    On Wed, Sep 24, 2008 at 2:52 PM, Greg Coates wrote:
    I'm getting errors when I try to login to my web app, which is set up to use
    the DBIC authentication plugin.



    Here's the relevant portion of my config file:

    authentication:
    default_realm: dbic
    realms:
    dbic:
    credential:
    class: Password
    password_field: usr_password
    password_type: clear
    store:
    class: DBIx::Class
    user_class: BlogDB::Users
    id_field: usr_login_name



    When I start the dev server, I see this:
    [debug] Loaded Config "/path/to/my/config/dev.yml"
    [debug] Setting up auth realm dbic



    Here's the login controller:

    sub login : Local {
    my ($self, $c) = @_;

    if ($c->request->params->{submitted} eq 'yes') {
    my $username = $c->request->params->{usr_login_name} || "";
    my $password = $c->request->params->{usr_password} || "";
    if ($c->authenticate({ username => $username,
    password => $password })) {
    $c->response->redirect( $c->uri_for('/posts') );
    return;
    } else {
    $c->stash->{message} = "Invalid user ID or password.";
    }
    }

    $c->stash->{template} = 'users/login.tt';
    $c->stash->{stylesheet} = 'form.css';
    }


    The login form displays fine, but when I try to log in using a uid/password
    combo that IS in the database, I get this error:

    [debug] "POST" request for "users/login"
    [debug] Path is "users/login"
    [error] Caught exception in MyApp::Controller::Users->login "User retrieval
    failed: no columns from BlogDB::Users were provided at
    /usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm
    line 63"


    I've googled for solutions until my fingertips are numb with no luck. I
    suspect there's some stupid little problem that I'm missing. Can anyone
    shed some light on this issue for me?

    Thanks,
    Greg
    You probably want $c->authenticate({ usr_login_name => $username,
    usr_password => $password });

    The parameters passed into authenticate match what your DBIC schema
    class declares.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedSep 24, '08 at 10:52p
activeSep 24, '08 at 11:50p
posts3
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Greg Coates: 2 posts Jay Shirley: 1 post

People

Translate

site design / logo © 2022 Grokbase