Hi,

Im trying to convert a legacy program over to Catalyst, and in the process have
tried to use the new Auth framework that i havent used before. Im having some
problems that i cant debug, though, even though it looks like im doing things 
right.

I got my setup from the docs and Tutorial. In my base class i use  
Authentication,
Session Session::Store::DBIC, and Session::State::Cookie. My config is:

 __PACKAGE__->config->{'Plugin::Authentication'} = {  
     default_realm => 'dbic',
     realms => {
     dbic => {
         credential => {
         class => 'Password',
         password_type => 'clear'
         },
         store => {
         class => 'DBIx::Class',
         user_class => 'MyDB::User'
         }
     }
     }
 };

(By the way i dont really know what 'realms' does, as im not using them now, but
i thought that i can just use anything as long as im not using it directly.)

Then my login routine includes:

 my $username = $c->request->params->{username} || "";
  my $password = $c->request->params->{password} || "";

  # If the username and password values were found in form
  if ($username && $password) {
      $c->log->debug("we have a username and pw");
      $c->log->debug("username is >$username<, password is >$password<");
    # Attempt to log the user in
    if ($c->authenticate({ login => $username, 
               password => $password })) {
# ...

(The name of my "username" field in the underlying table is "login" for legacy
reasons. But i thought thta using "login => $username" would address this;
login is the right column in the table itself.)

When i run DBIC_TRACE, the SQL that's executed _does_ return the user object
associated with this username and password combo. However, when i run this,
my log shows:

[debug] Path is "login"
[debug] we have a username and pw
[debug] username is >testuser<, password is >passw0rd<
[debug] Unable to locate user matching user info provided

Since the SQL is returning the right thing, and everything else looks OK, i cant
tell why this is failing. Can someone give me some advice on debugging this?

Thanks!




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

Reply via email to