[Catalyst] error using session and authn plug-ins under apache

leonard.a.jaffe at jpmchase.com leonard.a.jaffe at jpmchase.com
Fri Jul 28 21:24:34 CEST 2006


> Yuval Kogman <nothingmuch at woobling.org> 07/28/2006 03:04 PM
> 
> > On Fri, Jul 28, 2006 at 14:39:35 -0400, leonard.a.jaffe at jpmchase.com 
wrote:
> > I've overridden Credential::login() so that I can pluck the user's 
name 
> > out of the ether.
> 
> Please paste that method
#######################################
# my login method
#######################################
sub login {
  my ( $c, $user, $password, @rest ) = @_;
  unless ($user) {
     $c->log->debug("Can't login a user without a user object or user ID") 
if $c->debug;
     return;
  }

  unless ( Scalar::Util::blessed($user) and 
$user->isa("Catalyst::Plugin::Authentication::User") ) {
    if ( my $user_obj = $c->get_user( $user ) ) {
      $user = $user_obj;
    } else {
      $c->log->debug("User '$user' doesn't exist in the default store") if 
$c->debug;
      return;
    }
  }
  $c->set_authenticated($user);
  $c->log->debug("Successfully authenticated user " . $user->standardid) 
if $c->debug;
  return 1;
}


> > Hmm. I'll look around in my site/lib directories and see if I can spot 

> > anything. Maybe 
> > something needs upgraded and just doesn't know it.
> 
>    perl -MCPAN -e shell
>    cpan> r

Well yes, but I don't upgrade stuff just to keep a cpan->r quiet.


> > > Please post code/configuration if you can.
> > Which bits would be most helpful?
> 
> The configuration, for startes, the code calling ->login, the list
> of plugins used by your app, the main app's .pm file, and the
> controller code that's causing that request =)
I think every controller is causing this request, since the session 
logic is under cat's hood, and login() is called from Root.pm's auto 
method.
The only change I'm thinking of making there is to see if the user is 
logged
before calling out to login().  Otherwise it get username from request 
header, 
feed to login, profit.

###################################
# My YAML config
###################################
-- 
name: dtsis 
DOCUMENT_ROOT: '/dcsis_intranet/dev/dtsis/root/static'
DOCUMENT_ROOT_WWW: '/static'
root: '/dtsis'
options:
   datetime_class: 'DateTime'
cache:
   storage: '/dcsis_intranet/dev/tmp/dtsis/cache'
   expires: 86400
static:
   debug: 1
   include_path:
      - '/dcsis_intranet/dev/dtsis/root/static'
      - '/dcsis_intranet/dev/dtsis/root'
   ignore_extensions:
      - tt
session:
   dbic_class: 'dtsis::Sessions'
   expires: 3600 
#   storage: '/dcsis_intranet/dev/tmp/dtsis/session'
#authorization:
#  dbic:
#     role_class: 'dtsis::Role'
#     role_field: 'role'
#     role_rel: 'user_roles'
#      user_role_user_field: 'user'
authentication:
   dbic:
      user_class: 'dtsis::User'
      user_field: 'standardid'


#############################
# my list of plugins
#############################
                   -Debug 
                   Dumper 
                   ConfigLoader 
                   StackTrace 
                   Static::Simple 
                   DefaultEnd 
                   FillInForm 
                   Cache::FileCache
                   FormValidator::Simple::RESTfull 
                   Authentication
                   Authentication::Store::DBIC
                   Authentication::Credential::SiteMinder






-----------------------------------------
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060728/4767f9e9/attachment-0001.htm 


More information about the Catalyst mailing list