You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by trondal <tr...@stud.ntnu.no> on 2005/01/03 13:35:04 UTC

Auth-fw problem: Passing username to SQL-transformer fails in Authenticatation resource

Hello. I'm following the sample Authentication-fw (without flow).
I have successfully set up my sitemap, and everything works when the
authentication resource is the default userlist.xml. However I want my
resource to come from mysql.

<!--this passes the control to authenticate at first-->
<map:match pattern="do-login">
 <map:act type="auth-login">
   <map:parameter name="handler" value="demohandler"/>
   <map:parameter name="parameter_name"
value="{request-param:username}"/>
   <map:redirect-to uri="protected"/>
 </map:act>
 <!-- something was wrong, try it again -->
 <map:redirect-to uri="login"/>
 </map:match> 

The vairables is passed from here ok, I've checked using XML
serializers.
However I doesn't seem that the parameter "parameter_name" gets
processed in the authentication resource:

<map:match pattern="authenticate">
  <map:generate src="sql.xml"/>
  <map:transform type="sql">
    <map:parameter name="use-connection" value="asta"/>    
    <!--map:parameter name="parameter_name" value="trondal"/-->  <-- the
sql.xml works when I use this
    <map:parameter name="use-request-parameters" value="true"/>
  </map:transform>
  <map:transform src="authenticate.xsl"/>
  <map:serialize type="xml"/>    
</map:match>  

The sql.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<document>
  <sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
    <sql:use-connection>asta</sql:use-connection>
    <sql:query>Select * from users where ID='<sql:substitute-value
sql:name="parameter_name"/>'   
    </sql:query>
  </sql:execute-query>
</document>

I've checked that the SQL is working properly and is indeed getting the
right XML when I use a test-pipeline with hard-coded parameters.

So the problem is that it seems the SQL transformer is not getting the
parameter from the auth-handler. Am I using the wrong syntax? 

trondal
 



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