I have had success using AxKit::XSP::Auth to authenticate passwords, but
when I acutally try to use the <auth:login> tag, I run into problems.  I've
stripped the authentication parts out of the following script to illustrate
the problem.
 
<?xml version="1.0"?>
<?xml-stylesheet href="NULL" type="application/x-xsp"?>
<xsp:page language="Perl"
        xmlns:xsp="http://www.apache.org/1999/XSP/Core";
        xmlns:session="http://www.apache.org/1999/XSP/Session";
        xmlns:param="http://axkit.org/NS/xsp/param/v1";
        xmlns:auth="http://www.creITve.de/2002/XSP/Auth";
        xmlns="http://www.w3.org/1999/xhtml";>
<html>
    <head>
        <title>Login Demo</title>
    </head>
    <body>
        <h1>Login Demo</h1>
 
    <auth:login destination="/index.html">
      <auth:access type="user">xxxxx</auth:access>
    </auth:login>
 
    </body>
</html>
</xsp:page>
 
I get the error messages:
 
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] fast handler
called for /apps/discussions/login3.xsp
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Running
plugin: Apache::AxKit::Plugin::Passthru
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Running
plugin: Apache::AxKit::Plugin::Passthru
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Content
Provider Override: Apache::AxKit::Provider::File
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] decoding from
UTF-8
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] [req] File
Provider given $r: /home/apache/htdocs/apps/discussions/login3.xsp
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] checking if
we process this resource
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] media:
screen, preferred style: #default
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Cache: key =
a31d12d25118f62b6e42826f9681cdba
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] getting
styles and external entities from the XML
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] styles not
cached - calling $provider->get_styles()
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] using XS
get_styles (libxml2)
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] encoding to
UTF-8
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] calling
xs_get_styles_fh()
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] calling
xs_get_styles_str()
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] parse_pi:
href = NULL
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] parse_pi:
type = application/x-xsp
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] xs_get_styles
returned: , , {http://www.apache.org/1999/XSP/Core}page
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Calling
GetMatchingProcessors with (screen, , , ,
{http://www.apache.org/1999/XSP/Core}page)
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] get_styles:
loading style modules
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] get_styles:
looking for mapping for style type: 'application/x-xsp'
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] cache doesn't
exist
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] some
condition failed. recreating output
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] styles:
Apache::AxKit::Language::XSP(NULL)
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Style
Provider Override: Apache::AxKit::Provider::File
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] [uri] File
Provider looking up uri NULL
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] [uri] File
Provider set filename to /home/apache/htdocs/apps/discussions/NULL
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] about to
execute: Apache::AxKit::Language::XSP::handler
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] XSP: parsing
fh
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] XSP: Parser
returned doc
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Recompiling
XSP script
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] package
Apache::AxKit::Language::XSP::ROOT::home::apache::htdocs::apps::discussions:
:login3_2exsp;
use Apache;
use Apache::Constants qw(:common);
use XML::LibXML;
Apache::AxKit::Language::XSP::Page->import( qw(__mk_text_node
__mk_comment_node __mk_ns_element_node __mk_element_node) );#initialize xsp
namespace
use Apache::AxKit::Plugin::Session;
use Time::Piece;
# Evil hack to globally prepare a session object. Actually, it is quite
waterproof...
my $session;
{ my $handler = \&xml_generator;
*xml_generator = sub { $session = Apache->request->pnotes("SESSION"); goto
$handler; }; }
 
use Apache::AxKit::Plugin::Session;
use Time::Piece;
# Evil hack to globally prepare a session object. Actually, it is quite
waterproof...
my $global;
{ my $handler = \&xml_generator;
*xml_generator = sub { $global = Apache->request->pnotes("GLOBAL"); goto
$handler; }; }
 
#initialize xsp namespace
 
@Apache::AxKit::Language::XSP::ROOT::home::apache::htdocs::apps::discussions
::login3_2exsp::ISA = ('Apache::AxKit::Language::XSP::Page');
sub xml_generator {
my $class = shift;
my ($r, $cgi, $document, $parent) = @_;
 
$parent = __mk_ns_element_node($document, $parent,
q|http://www.w3.org/1999/xhtml|,q|html|);
$parent = __mk_ns_element_node($document, $parent,
q|http://www.w3.org/1999/xhtml|,q|head|);
$parent = __mk_ns_element_node($document, $parent,
q|http://www.w3.org/1999/xhtml|,q|title|);
__mk_text_node($document, $parent, q|Login Demo|);
$parent = $parent->getParentNode;
$parent = $parent->getParentNode;
$parent = __mk_ns_element_node($document, $parent,
q|http://www.w3.org/1999/xhtml|,q|body|);
$parent = __mk_ns_element_node($document, $parent,
q|http://www.w3.org/1999/xhtml|,q|h1|);
__mk_text_node($document, $parent, q|Login Demo|);
$parent = $parent->getParentNode;
do { local(%_) = (); my ($attr_destination); $attr_destination =
q%/index.html%; do { $_{q%access%} ||= []; push @{$_{q%access%}}, do {local
(%_) = (); $_{q%type%} = q%user%;  $_{q%value%} = "".q%xxxxx%;  \%_; };  };
foreach my $key (keys %{$session}) {
 delete $$session{$key} if substr($key,0,12) eq 'auth_access_';
}
foreach my $perm (@{$_{"access"}}) {
 if (!exists $$session{"auth_access_".$$perm{'type'}}) {
  $$session{"auth_access_".$$perm{'type'}} = $$perm{'value'};
 } elsif (!ref($$session{"auth_access_".$$perm{'type'}})) {
  $$session{"auth_access_".$$perm{'type'}} = {$$perm{'value'} => undef,
$$session{"auth_access_".$$perm{'type'}} => undef};
 } else {
  $$session{"auth_access_".$$perm{'type'}}{$$perm{'value'}} = undef;
 }
}
my $auth_type = $r->auth_type;
no strict 'refs';
$r->pnotes('INPUT')->{'credential_0'} = $$session{'auth_access_user'};
my $rc;
if (defined $attr_destination) {
 $rc = $auth_type->login($r,$attr_destination);
} else {
 $rc = $auth_type->login($r);
}
$rc = $auth_type->external_redirect($attr_destination||$r->uri) if $rc ==
OK;
my $old_id = $$global{'auth_online_users'}{$$session{'auth_access_user'}};
if ($old_id && $old_id ne $$session{'_session_id'}) {
 my $oldsession = $auth_type->_get_session_from_store($r,$old_id);
 eval {
  %$oldsession = ('_session_id' => $old_id);
  tied(%$oldsession)->delete;
 };
}
$$global{'auth_online_users'}{$$session{'auth_access_user'}} =
$$session{'_session_id'};
$$global{'auth_logins'}++;
throw Apache::AxKit::Exception::Retval(return_code => $rc);
 };
$parent = $parent->getParentNode;
$parent = $parent->getParentNode;
 
return OK;
}
 
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] XSP
Compilation finished
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Turning off
cache!
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Cache: key =
cc9b44ae51a59c5948a34b413afa2aa6
[Fri Apr  4 11:15:31 2003] [warn] [client 192.168.1.3] [AxKit] Caught an
exception
[Fri Apr  4 11:15:31 2003] [error] [client 192.168.1.3] [AxKit] [Error]
Can't use an undefined value as a HASH reference at (eval 110) line 52.
 
[Fri Apr  4 11:15:31 2003] [error] [client 192.168.1.3] [AxKit] From:
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/Apache/AxKit/Exception.pm :
9
[Fri Apr  4 11:15:31 2003] [error] [client 192.168.1.3] [AxKit] [Backtrace]
Can't use an undefined value as a HASH reference at (eval 110) line 52.
 
Apache::AxKit::Exception::new('Apache::AxKit::Exception::Error','-text','Can
\'t use an undefined value as a HASH reference at (eval 11...') called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 988
 AxKit::prep_exception('Can\'t use an undefined value as a HASH reference at
(eval 11...') called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 162
 AxKit::__ANON__('Can\'t use an undefined value as a HASH reference at (eval
11...') called at (eval 110) line 52
 
Apache::AxKit::Language::XSP::ROOT::home::apache::htdocs::apps::discussions:
:login3_2exsp::xml_generator('Apache::AxKit::Language::XSP::ROOT::home::apac
he::htdocs::app...','AxKit::Apache=SCALAR(0x84b0320)','Apache::Request=SCALA
R(0x887b334)','XML::LibXML::Document=SCALAR(0x887b1fc)') called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/Apache/AxKit/Language/XSP.pm
line 1098
 
Apache::AxKit::Language::XSP::Page::handler('Apache::AxKit::Language::XSP::R
OOT::home::apache::htdocs::app...','AxKit::Apache=SCALAR(0x84b0320)','Apache
::Request=SCALAR(0x887b334)','XML::LibXML::Document=SCALAR(0x887b1fc)')
called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/Apache/AxKit/Language/XSP.pm
line 173
 eval {...} called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/Apache/AxKit/Language/XSP.pm
line 173
 
Apache::AxKit::Language::XSP::handler('Apache::AxKit::Language::XSP','AxKit:
:Apache=SCALAR(0x84b0320)','Apache::AxKit::Provider::File=HASH(0x85a1a18)','
Apache::AxKit::Provider::File=HASH(0x835484c)',1) called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 739
 
AxKit::process_request('AxKit::Apache=SCALAR(0x84b0320)','Apache::AxKit::Pro
vider::File=HASH(0x85a1a18)','ARRAY(0x859c71c)','undef') called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 461
 
AxKit::run_axkit_engine('AxKit::Apache=SCALAR(0x84b0320)','Apache::AxKit::Pr
ovider::File=HASH(0x85a1a18)') called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 288
 eval {...} called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 279
 
AxKit::main_handler('AxKit::Apache=SCALAR(0x84b0320)','Apache::AxKit::Provid
er::File=HASH(0x85a1a18)') called at
/usr/local/lib/perl5/site_perl/5.8.0/i586-linux/AxKit.pm line 193
 AxKit::fast_handler('AxKit::Apache=SCALAR(0x84b0320)') called at /dev/null
line 0
 eval {...} called at /dev/null line 0

Reply via email to