cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Flynn <pfl...@ucc.ie>
Subject Authentication puzzle
Date Tue, 09 Jan 2007 16:57:59 GMT
I am trying to get simple authentication to work for a single document,
using local files for the authentication step, but I can't get it to 
return an authentication success.

The following works fine when run using Saxon from the commandline,
with userid=peter and password=GHYTFVN.map4h (ie it returns the expected 
authentication XML:
<authentication><ID>abcd</ID><role>*</role><data>authok:peter</data></authentication>
and when run with other data it returns the failure:
<authentication><data>authfail:peter</data></authentication>
as described in
http://cocoon.apache.org/2.1/developing/webapps/authentication.html

But run via Cocoon it only fails. Does Cocoon automatically perform the 
required crypt(3) on the password string from the form before passing 
the parameter_password into the handler authentication URI?

///Peter

XML:
<users>
   <user id="peter" authority="abcd">
     <name>Peter Flynn</name>
     <branchuri>*</branchuri>
     <crypt>GHYTFVN.map4h</crypt>
   </user>
</users>

XSLT:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0">

   <xsl:output method="xml"/>
   <xsl:param name="userid"/>
   <xsl:param name="password"/>

   <xsl:template match="/">
     <authentication>
       <xsl:choose>
         <xsl:when test="users/user/@id=$userid and
                         users/user[@id=$userid]/crypt=$password">
           <ID>
             <xsl:value-of select="users/user[@id=$userid]/@authority"/>
           </ID>
           <role>
             <xsl:value-of select="users/user[@id=$userid]/branchuri">
           </role>
           <data>
             <xsl:text>authok:</xsl:text>
             <xsl:value-of select="users/user[@id=$userid]/@id"/>
           </data>
         </xsl:when>
         <xsl:otherwise>
           <data>
             <xsl:text>authfail:</xsl:text>
             <xsl:value-of select="users/user[@id=$userid]/@id"/>
           </data>
         </xsl:otherwise>
       </xsl:choose>
     </authentication>
   </xsl:template>

</xsl:stylesheet>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message