....what do I do...? :-)

I've been trying to figure out for a few days now how to use the XSP 
Auth taglib, but I just can't "get it". This is extremely embarrasing, 
since the manpage says it should be easy. 

All I want to do, is to have a login script where those who want to log 
in can do so. I don't want to bother those of my users who just want 
read with logging in. For those who log in, I want to set a single 
cookie to use as session object, those who do not should not be 
bothered with a cookie. 

I'm using a patched version of the Session plugin I got from Mark some 
time ago, but I'm not taking his approach to the problem, I try to 
avoid any Perl code in the XML. I also have my own modifications to 
allow the true and false child-elements, as discussed in another 
thread. 

I see Mark has been troubling with the credential_0  directly, but 
looking at the code, and the example J�rg's example post 
< http://maclux-rz.uibk.ac.at/~maillists/axkit-users/msg03634.shtml >
I don't understand why this should be necessary.... 

I just made the following XSP:

<?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:auth="http://www.creITve.de/2002/XSP/Auth";
        xmlns:session="http://www.apache.org/1999/XSP/Session";
        xmlns:param="http://axkit.org/NS/xsp/param/v1";
        xmlns="http://www.w3.org/1999/xhtml";>
<html>
    <head>
        <title>Auth Login Test</title>
    </head>
    <body>
      <auth:password-matches>
        <auth:encrypted>$1$jsdxRBEt$IzCeNthea4KqzkzNB7sT4/</auth:encrypted> 
        <auth:clear><param:passwd/></auth:clear>
        <auth:true>
          <auth:login>
            <auth:access type="user">
              test
            </auth:access>
          </auth:login>
          <strong>Password is valid</strong>
        </auth:true>
        <auth:false><em>Password is invalid</em></auth:false>
      </auth:password-matches>
    </body>
</html>
</xsp:page>

Since the content of the auth:access element when it has type="user" 
should be the user name, I kind of expected this to "just work". :-) 

I've done many weird things, and sometimes, I've seen the "Password is 
valid" that I have in the above code. Right now, I get a 500, and the 
following log entry, which doesn't mean anything to me...:

 [AxKit] [Error] Can't use an undefined value as a HASH reference at 
(eval 94) line 54.

But I guess there is something more fundamental I haven't grasped, and 
I've got this feeling it has to do with this credential_0 variable, but 
I can't see in what direction I should be going... Any help, 
pleeeeease?

The relevant parts of my config (if it is of interest) is:
PerlModule Apache::AxKit::Plugin::Session
AxAddPlugin Apache::AxKit::Plugin::Session

AxAddXSPTaglib AxKit::XSP::Auth
AxAddXSPTaglib AxKit::XSP::Session
AxAddXSPTaglib AxKit::XSP::Global
AxAddXSPTaglib AxKit::XSP::Param

<Location /test/>
    AuthType Apache::AxKit::Plugin::Session
    AuthName AxKitSession
    PerlSetVar AxKitSessionGuest guest
    PerlAuthenHandler Apache::AxKit::Plugin::Session->authenticate
    PerlAuthzHandler Apache::AxKit::Plugin::Session->authorize
    require valid-user
</Location>

However, I'm not trying to access /test/ now, I just access /login.xsp 
with the hope of seeing a cookie set... 

Best,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]
Homepage: http://www.kjetil.kjernsmo.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to