You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Senhaji <os...@wanadoo.fr> on 2002/11/05 15:49:08 UTC

Authentication Resource

Hi all,

I am trying to protect my pages by using the Authentication framework. The
authentication resource uses XSP to access the datastore. I've tried almost
everything but I didn't succeed to retrieve the auth-login action parameters
("{request:...}") from within the XSP code to complete the select statement.

Here is the XSP code.
=====================

<xsp:page language="java"
          xmlns:xsp="http://apache.org/xsp"
	      xmlns:esql="http://apache.org/cocoon/SQL/v2"
	      xmlns:xsp-request="http://apache.org/xsp/request/2.0">


  <page>

   <content>
	<xsp:logic>
	  String userName = <xsp-request:get-parameter name="name"/>;
	  String password = <xsp-request:get-parameter name="password"/>;
	</xsp:logic>

   	<esql:connection>
     	<esql:pool>portal</esql:pool>
     	<esql:execute-query>

       <esql:query>
       		SELECT id,password,color from PORTALUSER_TABLE where id =
'$userName'
       </esql:query>

       <esql:results>
         <esql:row-results>
           <authentication>
           		<ID>
           			<esql:get-string column="id"/>
           		</ID>
           		<color>
           			<esql:get-string column="color"/>
           		</color>
           	</authentication>
         </esql:row-results>
       </esql:results>

     </esql:execute-query>
   	</esql:connection>

   </content>

  </page>
</xsp:page>

Any help

Thanks


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>