You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Manuel Ottaviano <co...@lst.tfo.upm.es> on 2006/07/27 11:43:45 UTC

Auth Problem , I'm lost

I've revised all the code but I still have the problem. I'm 
lost.............
Any suggestion??
best regards
manuel

-------- Mensaje original --------
Asunto: 	Auth Problem
Fecha: 	Wed, 26 Jul 2006 16:22:03 +0200
De: 	Manuel Ottaviano <co...@lst.tfo.upm.es>
Responder a: 	users@cocoon.apache.org
Organización: 	Life Supporting Technologies - UPM
Para: 	users@cocoon.apache.org



Hello Cocoon developers, I've problems with the authentication framework.
I use the example in   "samples/blocks/authentication-fw/login"
I want to authenticate against a mysql.
I've create a specific pipeline process that works correctly and 
generates an authentication file:


First I've define the following pipeline process:

<map:generate src="mysql.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="myheartDB"/>
<map:parameter name="user" value="{request-param:user}"/>
<map:parameter name="password" value="{request-param:password}"/>
<map:parameter name="product" 
value="{request-param:product}"/></map:transform>
<map:transform type="xslt" src="sql2html.xsl"/> 
<map:serialize />

and I've tested out from the authntification example. When the 
authentication is correct the application generates the following XML


<?xml version="1.0" encoding="ISO-8859-1"?>
<authentication xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<ID>bover</ID><role>cardiologist</role>
<data>
<product_id>1</product_id><name>Ramón</name><surname>Bover</surname><email/><telephone/>        

</data>
</authentication>


I test this part and I assume that is works

But when I insert the pipeline process inside the authentification URI 
the application does not authenticate and redirect to the login page 
[authntification failed?]
this is the declaration...

 <map:pipeline internal-only="true">
<!-- This is the authentication resource -->
<map:match pattern="authenticate">
<map:generate src="mysql.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="myheartDB"/>
<map:parameter name="user" value="{request-param:user}"/>
<map:parameter name="password" value="{request-param:password}"/>
<map:parameter name="product" 
value="{request-param:product}"/></map:transform>
<map:transform type="xslt" src="sql2html.xsl"/> 
 <map:serialize />
 </map:match>
 </map:pipeline>

but if I create a static XML file as output of the same application and 
I put in the auth URI the authentification framework works. this the 
declaration:
   <map:pipeline internal-only="true">
     <!-- This is the authentication resource -->
     <map:match pattern="authenticate">
   <map:generate src="auth.xml"/>     --> this is the static file.......
 
 <map:serialize />
     </map:match>
    
   
   </map:pipeline>


WHY???

Note: I've declared the sql transformer

Best Regards
Manuel Ottaviano



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





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


Re: Auth Problem solved :)

Posted by Manuel Ottaviano <co...@lst.tfo.upm.es>.
Thannks very much!!!
the problem was the declaration of the parameter in  the do-login match.

best regards
manuel ottaviano


321los@gmail.com escribió:
> Hi Manuel,
> that page helped me a  lot with my authentication issues:
> http://cocoon.apache.org/2.1/developing/webapps/authentication/authenticating_user.html 
> <http://cocoon.apache.org/2.1/developing/webapps/authentication/authenticating_user.html>
> There, it is also stated, that your parameters have to start with 
> 'parameter_'; e.g. my part of this looks like that:
>
> <map:match pattern="do-login">
>         <!-- try to login -->
>         <map:act type="auth-login">
>           <map:parameter name="handler" value="indexhandler"/>
>           <map:parameter name="parameter_name" 
> value="{request-param:username}"/>
>           <map:parameter name="parameter_pw" 
> value="{request-param:password}"/>
>           <map:redirect-to uri="protected-first"/>
>         </map:act>
>         <!-- something was wrong, try it again -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
> in my authenticate.xsl, I get these parameters as follows:
> <xsl:param name="name"/>
> <xsl:param name="pw"/>
>
> authenticate is in an extra pipeline in my sitemap:
> <map:pipeline internal-only="true">
>       <!-- Authentifizierung -->
>       <map:match pattern="authenticate">
>         <map:generate src="documents/xml/userlist.xml"/>
>         <map:transform src="documents/stylesheets/authenticate.xsl">
>           <map:parameter name="use-request-parameters" value="true"/>
>         </map:transform>
>         <map:serialize type="xml"/>
>       </map:match>
>
> regards
> Marco
>
>
>
>
> 2006/7/27, Manuel Ottaviano < cocoon@lst.tfo.upm.es 
> <ma...@lst.tfo.upm.es>>:
>
>     I've tested the application inside the authentication process.
>     I remove the internal only attribute and I change the action of
>     the form
>     (from do-login to authenticate)
>     I see the correct XML. :(
>     But authentication still no works .
>     I've also add to the do-login pipeline process the POST parameters
>     that
>     cocoon receives from the form..
>
>
>     <map:match pattern="do-login">
>             <!-- try to login -->
>             <map:act type="auth-login">
>               <map:parameter name="handler" value="demohandler"/>
>     <map:parameter name="parameter_name" value="{request-param:user}"/>
>     <map:parameter name="password" value="{request-param:password}"/>
>     <map:parameter name="product" value="{request-param:product}"/>
>               <map:redirect-to uri="product"/>
>             </map:act>
>             <!-- something was wrong, try it again -->
>             <map:redirect-to uri="login"/>
>           </map:match>
>
>     What's going on?
>     best regards
>     manuel
>
>     On 7/27/06, Manuel Ottaviano <cocoon@lst.tfo.upm.es
>     <ma...@lst.tfo.upm.es>> wrote:
>     >
>     >> ...but if I create a static XML file as output of the same
>     >> application and
>     >> I put in the auth URI the authentification framework works...
>     >
>     > Did you check that your other pipeline generates the exact same
>     output?
>     > Including no identical namespaces (or none if not required)?
>     >
>     > You can try this by removing the internal-only description.
>     >
>     > You could also use the LogTransformer to verify what's produced by
>     > your MySQL pipeline when you connect it.
>     >
>     > HTH,
>     > -Bertrand
>     >
>     >
>     ---------------------------------------------------------------------
>     > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>     > For additional commands, e-mail: users-help@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>     >
>     >
>     >
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>     For additional commands, e-mail: users-help@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>
>


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


Re: Auth Problem , I'm still lost

Posted by 32...@gmail.com.
Hi Manuel,
that page helped me a  lot with my authentication issues:
http://cocoon.apache.org/2.1/developing/webapps/authentication/authenticating_user.html
There, it is also stated, that your parameters have to start with
'parameter_'; e.g. my part of this looks like that:

<map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="indexhandler"/>
          <map:parameter name="parameter_name"
value="{request-param:username}"/>
          <map:parameter name="parameter_pw"
value="{request-param:password}"/>
          <map:redirect-to uri="protected-first"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

in my authenticate.xsl, I get these parameters as follows:
<xsl:param name="name"/>
<xsl:param name="pw"/>

authenticate is in an extra pipeline in my sitemap:
<map:pipeline internal-only="true">
      <!-- Authentifizierung -->
      <map:match pattern="authenticate">
        <map:generate src="documents/xml/userlist.xml"/>
        <map:transform src="documents/stylesheets/authenticate.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/>
      </map:match>

regards
Marco




2006/7/27, Manuel Ottaviano <co...@lst.tfo.upm.es>:
>
> I've tested the application inside the authentication process.
> I remove the internal only attribute and I change the action of the form
> (from do-login to authenticate)
> I see the correct XML. :(
> But authentication still no works .
> I've also add to the do-login pipeline process the POST parameters that
> cocoon receives from the form..
>
>
> <map:match pattern="do-login">
>         <!-- try to login -->
>         <map:act type="auth-login">
>           <map:parameter name="handler" value="demohandler"/>
> <map:parameter name="parameter_name" value="{request-param:user}"/>
> <map:parameter name="password" value="{request-param:password}"/>
> <map:parameter name="product" value="{request-param:product}"/>
>           <map:redirect-to uri="product"/>
>         </map:act>
>         <!-- something was wrong, try it again -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
> What's going on?
> best regards
> manuel
>
> On 7/27/06, Manuel Ottaviano <co...@lst.tfo.upm.es> wrote:
> >
> >> ...but if I create a static XML file as output of the same
> >> application and
> >> I put in the auth URI the authentification framework works...
> >
> > Did you check that your other pipeline generates the exact same output?
> > Including no identical namespaces (or none if not required)?
> >
> > You can try this by removing the internal-only description.
> >
> > You could also use the LogTransformer to verify what's produced by
> > your MySQL pipeline when you connect it.
> >
> > HTH,
> > -Bertrand
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Auth Problem , I'm still lost

Posted by Manuel Ottaviano <co...@lst.tfo.upm.es>.
I've tested the application inside the authentication process.
I remove the internal only attribute and I change the action of the form 
(from do-login to authenticate)
I see the correct XML. :(
But authentication still no works .
I've also add to the do-login pipeline process the POST parameters that 
cocoon receives from the form..


 <map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="demohandler"/>
 <map:parameter name="parameter_name" value="{request-param:user}"/>
 <map:parameter name="password" value="{request-param:password}"/>
 <map:parameter name="product" value="{request-param:product}"/>
          <map:redirect-to uri="product"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

What's going on?
best regards
manuel

On 7/27/06, Manuel Ottaviano <co...@lst.tfo.upm.es> wrote:
>
>> ...but if I create a static XML file as output of the same 
>> application and
>> I put in the auth URI the authentification framework works...
>
> Did you check that your other pipeline generates the exact same output?
> Including no identical namespaces (or none if not required)?
>
> You can try this by removing the internal-only description.
>
> You could also use the LogTransformer to verify what's produced by
> your MySQL pipeline when you connect it.
>
> HTH,
> -Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


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


Re: Auth Problem , I'm lost

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 7/27/06, Manuel Ottaviano <co...@lst.tfo.upm.es> wrote:

> ...but if I create a static XML file as output of the same application and
> I put in the auth URI the authentification framework works...

Did you check that your other pipeline generates the exact same output?
Including no identical namespaces (or none if not required)?

You can try this by removing the internal-only description.

You could also use the LogTransformer to verify what's produced by
your MySQL pipeline when you connect it.

HTH,
-Bertrand

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