You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Flavio Palumbo <fl...@fastwebnet.it> on 2004/01/23 11:48:56 UTC

problem with authentication

hi all,

i try to insert the authentication-fw example in my sitemap with no luck
; i'am able to start with the login page and authenticate me but when i
get my main menu every link i choose i always get "resource not found no
pipeline matched request".

i'm sure this is a newbie mistake but can't find where is.

can somebody help me ?

thanks a lot

Flavio

<!-- =========================== Pipelines =================================
-->

 <map:pipelines>

    <map:component-configurations>
      <authentication-manager>
        <handlers>
          <handler name="figa">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/authenticate"/>
          </handler>
        </handlers>
      </authentication-manager>
    </map:component-configurations>

    <map:pipeline>

      <map:match pattern="">
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================= -->
      <!-- Simple login page -->
      <!-- ================= -->
      <map:match pattern="login">
        <!-- if we are already logged in, redirect to the protected document
-->
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="protArea"/> 
          <map:redirect-to uri="protected"/>
        </map:act> 
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
        <map:transform type="encodeURL"/>
        <map:serialize/>
      </map:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="protArea"/>
          <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>

      <!-- ================ -->
      <!-- Protected area   -->
      <!-- ================ -->
      <map:match pattern="protected">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

            <map:generate src="docs/home.xml"/>
            <map:transform type="session"/>
            <map:transform src="stylesheets/apache.xsl"/>
            <map:transform type="encodeURL"/>
            <map:serialize/>

          <map:match pattern="*-operaz.html">
           <map:act set="process">
             <map:parameter name="descriptor" value="context://riskIdem/docs/operaz-form.xml"/>
             <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
             <map:transform src="stylesheets/apache.xsl"/>
             <map:serialize/>
           </map:act>
           <map:generate type="serverpages" src="docs/{1}-operaz.xsp"/>
           <map:transform src="stylesheets/apache.xsl"/>
           <map:serialize/>
          </map:match>

          <map:match pattern="*-operaz.xml">
            <map:act set="process">
              <map:parameter name="descriptor" value="context://riskIdem/docs/operaz-form.xml"/>
              <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
              <map:serialize type="xml"/>
            </map:act>
            <map:generate type="serverpages" src="docs/{1}-operaz.xsp"/>
            <map:serialize type="xml"/>
          </map:match>
        </map:act>


        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ========================================= -->
      <!-- Logout link which invalidates the session -->
      <!-- ========================================= -->
      <map:match pattern="do-logout">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
    </map:pipeline>

    <map:pipeline internal-only="true">
      <!-- This is the authentication resource -->
      <map:match pattern="authenticate">
        <map:generate src="docs/userlist.xml"/>
        <map:transform src="stylesheets/authenticate.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/>
      </map:match>


   <map:handle-errors>
    <map:transform src="stylesheets/system/error2document.xsl"/>
    <map:transform src="stylesheets/apache.xsl"/>
    <map:serialize status-code="500"/>
   </map:handle-errors>

  </map:pipeline>
 </map:pipelines>

</map:sitemap>



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


RE: problem with authentication

Posted by Morley Howell <mo...@cogeco.ca>.
Flavio,

I've no idea what would cause the exception. It looks like you're using
Jetty. I've used the auth fw with cocoon 2.1.3 under tomcat 4.1.27 and the
redirects worked fine. Maybe there's some issue with redirects under Jetty?
Maybe you could try running under tomcat and see what happens?

Morley

> -----Original Message-----
> From: Flavio Palumbo [mailto:flavio.palumbo@fastwebnet.it]
> Sent: Thursday January 29, 2004 8:05 AM
> To: users@cocoon.apache.org
> Subject: RE: problem with authentication
>
>
> Hi Morley,
>
> thanks for your replay, i got it.
>
> i was misteking many things in the XSP code.
>
> now it works and i can authenticate the user against the DB table
> as i hoped.
>
> making more tests, i tried to point directly a page in the protected area
> without authenticate myself, where i thought i'd be redirected to
> the login
> page ; instead i get an exception
> java.lang.ArrayIndexOutOfBoundsException.
>
> have you any suggestion ? below are the stack trace and the new sitemap.
>
> thanks a lot
>
> Flavio
>
> java.lang.ArrayIndexOutOfBoundsException
> 	at java.lang.System.arraycopy(Native Method)
> 	at
> org.mortbay.util.ByteBufferOutputStream.prewrite(ByteBufferOutputS
> tream.java:219)
> 	at
> org.mortbay.http.BufferedOutputStream.flush(BufferedOutputStream.java:187)
> 	at
> org.mortbay.http.ChunkingOutputStream.flush(ChunkingOutputStream.java:69)
> 	at
> org.mortbay.http.HttpOutputStream.flush(HttpOutputStream.java:482)
> 	at org.mortbay.http.HttpResponse.commit(HttpResponse.java:501)
> 	at org.mortbay.http.HttpResponse.sendRedirect(HttpResponse.java:463)
> 	at
> org.mortbay.jetty.servlet.ServletHttpResponse.sendRedirect(Servlet
> HttpResponse.java:432)
> 	at
> org.apache.cocoon.environment.http.HttpResponse.sendRedirect(HttpR
> esponse.java:132)
> 	at
> org.apache.cocoon.environment.http.HttpEnvironment.doRedirect(Http
> Environment.java:192)
> 	at
> org.apache.cocoon.environment.http.HttpEnvironment.redirect(HttpEn
> vironment.java:131)
> 	at
> org.apache.cocoon.environment.ForwardRedirector.globalRedirect(For
> wardRedirector.java:131)
> 	at
> org.apache.cocoon.webapps.authentication.components.DefaultAuthent
> icationManager.checkAuthentication(DefaultAuthenticationManager.java:373)
> 	at
> org.apache.cocoon.webapps.authentication.acting.AuthAction.act(Aut
> hAction.java:102)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.inv
> oke(ActTypeNode.java:152)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessin
> gNode.invokeNodes(AbstractParentProcessingNode.java:84)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatch
> Node.invoke(PreparableMatchNode.java:164)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessin
> gNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.in
> voke(PipelineNode.java:163)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessin
> gNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.i
> nvoke(PipelinesNode.java:152)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(T
> reeProcessor.java:354)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(T
> reeProcessor.java:307)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invok
> e(MountNode.java:133)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessin
> gNode.invokeNodes(AbstractParentProcessingNode.java:84)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatch
> Node.invoke(PreparableMatchNode.java:164)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessin
> gNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.in
> voke(PipelineNode.java:163)
> 	at
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessin
> gNode.invokeNodes(AbstractParentProcessingNode.java:108)
> 	at
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.i
> nvoke(PipelinesNode.java:152)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(T
> reeProcessor.java:354)
> 	at
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(T
> reeProcessor.java:307)
> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
> 	at
> org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
> 	at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplic
> ationHandler.java:294)
> 	at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
> 	at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
> 	at
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicat
> ionContext.java:507)
> 	at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
> 	at org.mortbay.http.HttpServer.service(HttpServer.java:863)
> 	at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
> 	at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
> 	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
> 	at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
> 	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
> 	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
>
> SITEMAP ---------------------------------------------------------------
>
>  <map:pipelines>
>
>     <map:component-configurations>
>       <authentication-manager>
>         <handlers>
>           <handler name="protArea">
>             <redirect-to uri="cocoon:/login"/>
>             <authentication uri="cocoon:raw:/authenticate"/>
>           </handler>
>         </handlers>
>       </authentication-manager>
>     </map:component-configurations>
>
>     <map:pipeline>
>
>       <map:match pattern="">
>         <map:redirect-to uri="login"/>
>       </map:match>
>
> <!--      <map:match pattern="authenticate">
>         <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
>           <map:parameter name="use-request-parameters" value="true"/>
>         <map:transform src="stylesheets/autentica.xsl"/>
>         <map:serialize type="xml"/>
>       </map:match> -->
>
>
>       <!-- ================= -->
>       <!-- Simple login page -->
>       <!-- ================= -->
>       <map:match pattern="login">
>         <!-- if we are already logged in, redirect to the
> protected document
> -->
>         <map:act type="auth-loggedIn">
>           <map:parameter name="handler" value="protArea"/>
>           <map:redirect-to uri="protected/home"/>
>         </map:act>
>         <map:generate src="docs/login.xml"/>
>         <map:transform src="stylesheets/simple-page2html.xsl"/>
>         <map:transform type="encodeURL"/>
>         <map:serialize/>
>       </map:match>
>
>       <!-- ========================================= -->
>       <!-- Form target which performs auth service   -->
>       <!-- ========================================= -->
>       <map:match pattern="do-login">
>         <!-- try to login -->
>         <map:act type="auth-login">
>           <map:parameter name="handler" value="protArea"/>
>           <map:parameter name="parameter_name"
> value="{request-param:username}"/>
>           <map:redirect-to uri="protected/home"/>
>         </map:act>
>         <!-- something was wrong, try it again -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <!-- ================ -->
>       <!-- Protected area   -->
>       <!-- ================ -->
>       <map:match pattern="protected/**">
>         <map:act type="auth-protect">
>           <map:parameter name="handler" value="protArea"/>
>
>           <map:match pattern="protected/home">
>             <map:generate src="docs/home.xml"/>
>             <map:transform type="session"/>
>             <map:transform src="stylesheets/apache.xsl"/>
>             <map:transform type="encodeURL"/>
>             <map:serialize/>
>           </map:match>
>
>           <map:match pattern="protected/*-operaz.html">
>            <map:act set="process">
>             <map:parameter name="descriptor"
> value="context://riskIdem/docs/operaz-form.xml"/>
>             <map:generate type="serverpages"
> src="docs/conferma-operaz.xsp"/>
>             <map:transform src="stylesheets/apache.xsl"/>
>             <map:serialize/>
>            </map:act>
>            <map:generate type="serverpages" src="docs/{1}-operaz.xsp"/>
>            <map:transform src="stylesheets/apache.xsl"/>
>            <map:serialize/>
>           </map:match>
>
>
>           <map:match pattern="protected/*-openp.html">
>            <map:generate type="serverpages" src="docs/{1}-openp.xsp"/>
>            <map:transform src="stylesheets/apache.xsl"/>
>            <map:serialize/>
>           </map:match>
>
>           <map:match pattern="protected/Ricerca-*.html">
>             <map:generate type="serverpages" src="docs/Ricerca-{1}.xsp"/>
>             <map:transform src="stylesheets/apache.xsl"/>
>             <map:serialize/>
>           </map:match>
>
>           <map:match pattern="protected/images/**.gif">
>             <map:read src="resources/images/{1}.gif"
> mime-type="image/gif"/>
>           </map:match>
>
>           <map:match pattern="protected/images/**.jpg">
>             <map:read src="resources/images/{1}.jpg"
> mime-type="image/jpg"/>
>           </map:match>
>
>           <map:match pattern="protected/images/**.png">
>             <map:read src="resources/images/{1}.png"
> mime-type="image/png"/>
>           </map:match>
>
>           <map:match pattern="protected/resources/**.css">
>             <map:read src="resources/styles/{1}.css"
> mime-type="text/css"/>
>           </map:match>
>
>           <map:match pattern="protected/resources/**.js">
>             <map:read src="resources/styles/{1}.js"
> mime-type="application/x-javascript"/>
>           </map:match>
>
>         </map:act>
>
>         <!-- something was wrong, redirect to login page -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <!-- ========================================= -->
>       <!-- Logout link which invalidates the session -->
>       <!-- ========================================= -->
>       <map:match pattern="do-logout">
>         <map:act type="auth-protect">
>           <map:parameter name="handler" value="protArea"/>
>
>           <map:act type="auth-logout"/>
>         </map:act>
>         <map:redirect-to uri="login"/>
>       </map:match>
>     </map:pipeline>
>
>    <map:pipeline internal-only="true">
>       <map:match pattern="authenticate">
>         <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
>           <map:parameter name="use-request-parameters" value="true"/>
>         <map:transform src="stylesheets/autentica.xsl"/>
>         <map:serialize type="xml"/>
>       </map:match>
>
> <!--    <map:handle-errors>
>     <map:transform src="stylesheets/system/error2document.xsl"/>
>     <map:transform src="stylesheets/apache.xsl"/>
>     <map:serialize status-code="500"/>
>    </map:handle-errors> -->
>
>   </map:pipeline>
> <!--      <map:match pattern="authenticate">
>         <map:generate src="docs/userlist.xml"/>
>         <map:transform src="stylesheets/authenticate.xsl">
>           <map:parameter name="use-request-parameters" value="true"/>
>         </map:transform>
>         <map:serialize type="xml"/> -->
>  </map:pipelines>
>
> </map:sitemap>
>
>
>
>
> ---------------------------------------------------------------------
> 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: problem with authentication

Posted by Flavio Palumbo <fl...@fastwebnet.it>.
Hi Morley,

thanks for your replay, i got it.

i was misteking many things in the XSP code. 

now it works and i can authenticate the user against the DB table as i hoped.

making more tests, i tried to point directly a page in the protected area
without authenticate myself, where i thought i'd be redirected to the login
page ; instead i get an exception java.lang.ArrayIndexOutOfBoundsException.

have you any suggestion ? below are the stack trace and the new sitemap.

thanks a lot

Flavio 

java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at org.mortbay.util.ByteBufferOutputStream.prewrite(ByteBufferOutputStream.java:219)
	at org.mortbay.http.BufferedOutputStream.flush(BufferedOutputStream.java:187)
	at org.mortbay.http.ChunkingOutputStream.flush(ChunkingOutputStream.java:69)
	at org.mortbay.http.HttpOutputStream.flush(HttpOutputStream.java:482)
	at org.mortbay.http.HttpResponse.commit(HttpResponse.java:501)
	at org.mortbay.http.HttpResponse.sendRedirect(HttpResponse.java:463)
	at org.mortbay.jetty.servlet.ServletHttpResponse.sendRedirect(ServletHttpResponse.java:432)
	at org.apache.cocoon.environment.http.HttpResponse.sendRedirect(HttpResponse.java:132)
	at org.apache.cocoon.environment.http.HttpEnvironment.doRedirect(HttpEnvironment.java:192)
	at org.apache.cocoon.environment.http.HttpEnvironment.redirect(HttpEnvironment.java:131)
	at org.apache.cocoon.environment.ForwardRedirector.globalRedirect(ForwardRedirector.java:131)
	at org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationManager.checkAuthentication(DefaultAuthenticationManager.java:373)
	at org.apache.cocoon.webapps.authentication.acting.AuthAction.act(AuthAction.java:102)
	at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:152)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
	at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
	at org.mortbay.http.HttpServer.service(HttpServer.java:863)
	at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
	at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)

SITEMAP ---------------------------------------------------------------

 <map:pipelines>

    <map:component-configurations>
      <authentication-manager>
        <handlers>
          <handler name="protArea">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/authenticate"/>
          </handler>
        </handlers>
      </authentication-manager>
    </map:component-configurations>

    <map:pipeline>

      <map:match pattern="">
        <map:redirect-to uri="login"/>
      </map:match>

<!--      <map:match pattern="authenticate">
        <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
          <map:parameter name="use-request-parameters" value="true"/>
        <map:transform src="stylesheets/autentica.xsl"/>
        <map:serialize type="xml"/>
      </map:match> -->


      <!-- ================= -->
      <!-- Simple login page -->
      <!-- ================= -->
      <map:match pattern="login">
        <!-- if we are already logged in, redirect to the protected document
-->
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="protArea"/> 
          <map:redirect-to uri="protected/home"/>
        </map:act> 
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
        <map:transform type="encodeURL"/>
        <map:serialize/>
      </map:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="protArea"/>
          <map:parameter name="parameter_name" value="{request-param:username}"/>
          <map:redirect-to uri="protected/home"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================ -->
      <!-- Protected area   -->
      <!-- ================ -->
      <map:match pattern="protected/**">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

          <map:match pattern="protected/home">
            <map:generate src="docs/home.xml"/>
            <map:transform type="session"/>
            <map:transform src="stylesheets/apache.xsl"/>
            <map:transform type="encodeURL"/> 
            <map:serialize/>
          </map:match>

          <map:match pattern="protected/*-operaz.html">
           <map:act set="process">
            <map:parameter name="descriptor" value="context://riskIdem/docs/operaz-form.xml"/>
            <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
            <map:transform src="stylesheets/apache.xsl"/>
            <map:serialize/>
           </map:act>
           <map:generate type="serverpages" src="docs/{1}-operaz.xsp"/>
           <map:transform src="stylesheets/apache.xsl"/>
           <map:serialize/>
          </map:match>


          <map:match pattern="protected/*-openp.html">
           <map:generate type="serverpages" src="docs/{1}-openp.xsp"/>
           <map:transform src="stylesheets/apache.xsl"/>
           <map:serialize/>
          </map:match>

          <map:match pattern="protected/Ricerca-*.html">
            <map:generate type="serverpages" src="docs/Ricerca-{1}.xsp"/>
            <map:transform src="stylesheets/apache.xsl"/>
            <map:serialize/>
          </map:match> 

          <map:match pattern="protected/images/**.gif">
            <map:read src="resources/images/{1}.gif" mime-type="image/gif"/>
          </map:match>

          <map:match pattern="protected/images/**.jpg">
            <map:read src="resources/images/{1}.jpg" mime-type="image/jpg"/>
          </map:match>

          <map:match pattern="protected/images/**.png">
            <map:read src="resources/images/{1}.png" mime-type="image/png"/>
          </map:match>

          <map:match pattern="protected/resources/**.css">
            <map:read src="resources/styles/{1}.css" mime-type="text/css"/>
          </map:match>

          <map:match pattern="protected/resources/**.js">
            <map:read src="resources/styles/{1}.js" mime-type="application/x-javascript"/>
          </map:match>

        </map:act>

        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ========================================= -->
      <!-- Logout link which invalidates the session -->
      <!-- ========================================= -->
      <map:match pattern="do-logout">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
    </map:pipeline>

   <map:pipeline internal-only="true">
      <map:match pattern="authenticate">
        <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
          <map:parameter name="use-request-parameters" value="true"/>
        <map:transform src="stylesheets/autentica.xsl"/>
        <map:serialize type="xml"/>
      </map:match>

<!--    <map:handle-errors>
    <map:transform src="stylesheets/system/error2document.xsl"/>
    <map:transform src="stylesheets/apache.xsl"/>
    <map:serialize status-code="500"/>
   </map:handle-errors> -->

  </map:pipeline> 
<!--      <map:match pattern="authenticate">
        <map:generate src="docs/userlist.xml"/>
        <map:transform src="stylesheets/authenticate.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/> -->
 </map:pipelines>

</map:sitemap>




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


RE: problem with authentication

Posted by Morley Howell <mo...@orbiscommunications.com>.
Flavio,

Have you tested your authentication pipeline independently of the auth
framework? I would suggest setting up a temporary matcher that just calls
your auth pipeline directly so that you can see what it's output is. That
way we'll know if the problem is in your auth pipeline or in the way you're
using the auth fw.

Thanks,

Morley

> -----Original Message-----
> From: Flavio Palumbo [mailto:flavio.palumbo@fastwebnet.it]
> Sent: Wednesday January 28, 2004 3:17 AM
> To: users@cocoon.apache.org
> Subject: Re: problem with authentication
>
>
> Excuse me if i repost the same question, but the problem is still alive.
>
> Maybe somebody can give me a little hint ... if a complete example is too
> much ;
> i'm quite new at this list so please forgive me if i mistake.
>
> Thanks
> Flavio
> >Hi all,
>
> i'am trying to authenticate users agaist a DB table using a XSP page with
> no success.
>
> i show the pages below, i'm not able to find where is the mistake
> (probably
> many ...) ; the page that accesses the DB table seems not to be executed
>
> >
>
> can somebody provide a complete example ? :-)
>
> i searched the mail archive back since 02/2003 but i was not able to find
> the right example to solve my problem.
>
> thanks a lot
> Flavio
>
>
> SITEMAP--------------------------------------------------
> >------------
>  <map:pipelines>
>
>     <map:component-configurations>
>       <authentication-manager>
>         <handlers>
>           <handler name="protArea">
>             <redirect-to uri="cocoon:/login"/>
>             <authentication uri="cocoon:raw:/
> >uthenticate"/>
>           </handler>
>         </handlers>
>       </authentication-manager>
>     </map:component-configurations>
>
>     <map:pipeline>
>
>       <map:match pattern="">
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <
> >-- ================= -->
>       <!-- Simple login page -->
>       <!-- ================= -->
>       <map:match pattern="login">
>         <!-- if we are already logged in, redirect to the
> protected document
> -->
>         <map:act type="auth-loggedIn">
>
> >         <map:parameter name="handler" value="protArea"/>
>           <map:redirect-to uri="protected/home"/>
>         </map:act>
>         <map:generate src="docs/login.xml"/>
>         <map:transform src="stylesheets/simple-page2html.xsl"/>
>   <!--
> > <map:transform type="encodeURL"/> -->
>         <map:serialize/>
>       </map:match>
>
>       <!-- ========================================= -->
>       <!-- Form target which performs auth service   -->
>       <!-- =====================================
> >=== -->
>       <map:match pattern="do-login">
>         <!-- try to login -->
>         <map:act type="auth-login">
>           <map:parameter name="handler" value="protArea"/>
>           <map:parameter name="parameter_name"
> value="{request-param:username
> >"/>
>           <map:redirect-to uri="protected/home"/>
>         </map:act>
>         <!-- something was wrong, try it again -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <!-- ================ -->
>       <!-- Protected area   -
> >>
>       <!-- ================ -->
>       <map:match pattern="protected/**">
>         <map:act type="auth-protect">
>           <map:parameter name="handler" value="protArea"/>
>          ......
>         </map:act>
>
>         <!-- something was wrong, re
> >irect to login page -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <!-- ========================================= -->
>       <!-- Logout link which invalidates the session -->
>       <!-- ======================================
> >== -->
>       <map:match pattern="do-logout">
>         <map:act type="auth-protect">
>           <map:parameter name="handler" value="protArea"/>
>
>           <map:act type="auth-logout"/>
>         </map:act>
>         <map:redirect-to uri="login"/>
>
> >  </map:match>
>     </map:pipeline>
>
>     <map:pipeline internal-only="true">
>       <!-- This is the authentication resource -->
>       <map:match pattern="authenticate">
>         <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
>
> >     <map:parameter name="use-request-parameters" value="true"/>
>         <map:transform src="stylesheets/autentica.xsl"/>
>         <map:serialize type="xml"/>
>       </map:match>
>
>    <map:handle-errors>
>     <map:transform src="stylesheets/system/er
> >or2document.xsl"/>
>     <map:transform src="stylesheets/apache.xsl"/>
>     <map:serialize status-code="500"/>
>    </map:handle-errors>
>
>   </map:pipeline>
>  </map:pipelines>
>
> </map:sitemap>
>
> ACCESS to user table------------------------------------
> >-----------------
>
> <?xml version="1.0"?>
>
> <xsp:page xmlns:xsp="http://apache.org/xsp"
>           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> 	  xmlns:esql="http://apache.org/cocoon/SQL/v2">
>
> 	  <esql:connection>
>            <esql:pool>
> >iskIdem</esql:pool>
> 	    <esql:execute-query>
> 	      <esql:query>
> 	        SELECT a0_user, a0_pass, a0_codiceSocOM,
> a0_codiceUserOM, a0_nazione,
> a0_lingua, a0_currency
>                 FROM a0_users
> 		WHERE a0_user = <esql:parameter><xsp-request:g
> >t-parameter name="username"/></esql:parameter>
> 	      </esql:query>
> 	      <esql:results>
>   	       <esql:row-results>
>                 <authentication>
>                  <user><esql:get-string column="a0_user"/></user>
>                 </authentica
> >ion>
> 	       </esql:row-results>
> 	      </esql:results>
>               <esql:no-results>
>                 <authentication>
>                 </authentication>
>               </esql:no-results>
> 	    </esql:execute-query>
> 	  </esql:connection>
> </xsp:
> >age>
>
> STYLESHEET to transform in
> XML-------------------------------------------------
> <?xml version="1.0"?>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>  <xsl:template match="authentication">
>   <authenticati
> >n>
>    <xsl:apply-templates/>
>   </authentication>
>  </xsl:template>
>
>  <xsl:template match="user">
>   <ID><xsl:apply-templates/></ID>
>  </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> ---------------------------------------------------------------------
>
> >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
>


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


Re: problem with authentication

Posted by Flavio Palumbo <fl...@fastwebnet.it>.
Excuse me if i repost the same question, but the problem is still alive.

Maybe somebody can give me a little hint ... if a complete example is too
much ;
i'm quite new at this list so please forgive me if i mistake.

Thanks
Flavio
>Hi all,

i'am trying to authenticate users agaist a DB table using a XSP page with
no success.

i show the pages below, i'm not able to find where is the mistake (probably
many ...) ; the page that accesses the DB table seems not to be executed

>

can somebody provide a complete example ? :-)

i searched the mail archive back since 02/2003 but i was not able to find
the right example to solve my problem.

thanks a lot
Flavio


SITEMAP--------------------------------------------------
>------------
 <map:pipelines>

    <map:component-configurations>
      <authentication-manager>
        <handlers>
          <handler name="protArea">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/
>uthenticate"/>
          </handler>
        </handlers>
      </authentication-manager>
    </map:component-configurations>

    <map:pipeline>

      <map:match pattern="">
        <map:redirect-to uri="login"/>
      </map:match>

      <
>-- ================= -->
      <!-- Simple login page -->
      <!-- ================= -->
      <map:match pattern="login">
        <!-- if we are already logged in, redirect to the protected document
-->
        <map:act type="auth-loggedIn">

>         <map:parameter name="handler" value="protArea"/>
          <map:redirect-to uri="protected/home"/>
        </map:act>
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
  <!--     
> <map:transform type="encodeURL"/> -->
        <map:serialize/>
      </map:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- =====================================
>=== -->
      <map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="protArea"/>
          <map:parameter name="parameter_name" value="{request-param:username
>"/>
          <map:redirect-to uri="protected/home"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================ -->
      <!-- Protected area   -
>>
      <!-- ================ -->
      <map:match pattern="protected/**">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/>
         ......
        </map:act>

        <!-- something was wrong, re
>irect to login page -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ========================================= -->
      <!-- Logout link which invalidates the session -->
      <!-- ======================================
>== -->
      <map:match pattern="do-logout">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/>

          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="login"/>
   
>  </map:match>
    </map:pipeline>

    <map:pipeline internal-only="true">
      <!-- This is the authentication resource -->
      <map:match pattern="authenticate">
        <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
    
>     <map:parameter name="use-request-parameters" value="true"/>
        <map:transform src="stylesheets/autentica.xsl"/>
        <map:serialize type="xml"/>
      </map:match>

   <map:handle-errors>
    <map:transform src="stylesheets/system/er
>or2document.xsl"/>
    <map:transform src="stylesheets/apache.xsl"/>
    <map:serialize status-code="500"/>
   </map:handle-errors>

  </map:pipeline>
 </map:pipelines>

</map:sitemap>

ACCESS to user table------------------------------------
>-----------------

<?xml version="1.0"?>

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

	  <esql:connection>
           <esql:pool>
>iskIdem</esql:pool>
	    <esql:execute-query>
	      <esql:query>
	        SELECT a0_user, a0_pass, a0_codiceSocOM, a0_codiceUserOM, a0_nazione,
a0_lingua, a0_currency
                FROM a0_users
		WHERE a0_user = <esql:parameter><xsp-request:g
>t-parameter name="username"/></esql:parameter>
	      </esql:query>
	      <esql:results>
  	       <esql:row-results>
                <authentication>
                 <user><esql:get-string column="a0_user"/></user>
                </authentica
>ion>
	       </esql:row-results>
	      </esql:results>
              <esql:no-results>
                <authentication>
                </authentication>
              </esql:no-results>
	    </esql:execute-query>
	  </esql:connection>
</xsp:
>age>

STYLESHEET to transform in XML-------------------------------------------------
<?xml version="1.0"?>

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

 <xsl:template match="authentication">
  <authenticati
>n>
   <xsl:apply-templates/>
  </authentication>
 </xsl:template>

 <xsl:template match="user">
  <ID><xsl:apply-templates/></ID>
 </xsl:template>

</xsl:stylesheet>



---------------------------------------------------------------------

>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: problem with authentication

Posted by Flavio Palumbo <fl...@fastwebnet.it>.
Hi all,

i'am trying to authenticate users agaist a DB table using a XSP page with
no success.

i show the pages below, i'm not able to find where is the mystake (probably
many ...) ; the page that accesses the DB table seems not to be executed


can somebody provide a complete example ? :-)

i searched the mail archive back since 02/2003 but i was not able to find
the right example to solve my problem.

thanks a lot
Flavio


SITEMAP---------------------------------------------------------------
 <map:pipelines>

    <map:component-configurations>
      <authentication-manager>
        <handlers>
          <handler name="protArea">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/authenticate"/>
          </handler>
        </handlers>
      </authentication-manager>
    </map:component-configurations>

    <map:pipeline>

      <map:match pattern="">
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================= -->
      <!-- Simple login page -->
      <!-- ================= -->
      <map:match pattern="login">
        <!-- if we are already logged in, redirect to the protected document
-->
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="protArea"/> 
          <map:redirect-to uri="protected/home"/>
        </map:act> 
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
  <!--       <map:transform type="encodeURL"/> -->
        <map:serialize/>
      </map:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="protArea"/>
          <map:parameter name="parameter_name" value="{request-param:username}"/>
          <map:redirect-to uri="protected/home"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================ -->
      <!-- Protected area   -->
      <!-- ================ -->
      <map:match pattern="protected/**">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 
         ......
        </map:act>

        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ========================================= -->
      <!-- Logout link which invalidates the session -->
      <!-- ========================================= -->
      <map:match pattern="do-logout">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
    </map:pipeline>

    <map:pipeline internal-only="true">
      <!-- This is the authentication resource -->
      <map:match pattern="authenticate">
        <map:generate type="serverpages" src="docs/autenticaLogin.xsp"/>
          <map:parameter name="use-request-parameters" value="true"/>
        <map:transform src="stylesheets/autentica.xsl"/>
        <map:serialize type="xml"/>
      </map:match>

   <map:handle-errors>
    <map:transform src="stylesheets/system/error2document.xsl"/>
    <map:transform src="stylesheets/apache.xsl"/>
    <map:serialize status-code="500"/>
   </map:handle-errors>

  </map:pipeline>
 </map:pipelines>

</map:sitemap>

ACCESS to user table------------------------------------------------------

<?xml version="1.0"?>

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

	  <esql:connection>
           <esql:pool>riskIdem</esql:pool>
	    <esql:execute-query>
	      <esql:query>
	        SELECT a0_user, a0_pass, a0_codiceSocOM, a0_codiceUserOM, a0_nazione,
a0_lingua, a0_currency
                FROM a0_users
		WHERE a0_user = <esql:parameter><xsp-request:get-parameter name="username"/></esql:parameter>
	      </esql:query>
	      <esql:results>
  	       <esql:row-results>
                <authentication>
                 <user><esql:get-string column="a0_user"/></user>
                </authentication>
	       </esql:row-results>
	      </esql:results>
              <esql:no-results>
                <authentication>
                </authentication>
              </esql:no-results>
	    </esql:execute-query>
	  </esql:connection>
</xsp:page>

STYLESHEET to transform in XML-------------------------------------------------
<?xml version="1.0"?>

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

 <xsl:template match="authentication">
  <authentication>
   <xsl:apply-templates/>
  </authentication>
 </xsl:template>

 <xsl:template match="user">
  <ID><xsl:apply-templates/></ID>
 </xsl:template>

</xsl:stylesheet>



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


Re: problem with authentication

Posted by Flavio Palumbo <fl...@fastwebnet.it>.
Thanks Morley and Joerg,

i found in the mail archive something that moved me forward. 

now my sitemap looks as below and it seems to work.

sure i need to rewrite it, cause looking at the mails on list i understood
it is complicated, and anyway i need to make more tests and complete it
with more feature.

thanks a lot
Flavio

<!-- =========================== Pipelines =================================
-->

 <map:pipelines>

    <map:component-configurations>
      <authentication-manager>
        <handlers>
          <handler name="protArea">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/authenticate"/>
          </handler>
        </handlers>
      </authentication-manager>
    </map:component-configurations>

    <map:pipeline>

      <map:match pattern="">
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================= -->
      <!-- Simple login page -->
      <!-- ================= -->
      <map:match pattern="login">
        <!-- if we are already logged in, redirect to the protected document
-->
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="protArea"/> 
          <map:redirect-to uri="protected/home"/>
        </map:act> 
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
  <!--       <map:transform type="encodeURL"/> -->
        <map:serialize/>
      </map:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="protArea"/>
          <map:parameter name="parameter_name" value="{request-param:username}"/>
          <map:redirect-to uri="protected/home"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================ -->
      <!-- Protected area   -->
      <!-- ================ -->
      <map:match pattern="protected/**">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

          <map:match pattern="protected/home">
            <map:generate src="docs/home.xml"/>
    <!--         <map:transform type="session"/> -->
            <map:transform src="stylesheets/apache.xsl"/>
    <!--        <map:transform type="encodeURL"/> -->
            <map:serialize/>
          </map:match>

          <map:match pattern="protected/cerca-operaz.html">
           <map:act set="process">
             <map:parameter name="descriptor" value="context://riskIdem/docs/operaz-form.xml"/>
             <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
             <map:transform src="stylesheets/apache.xsl"/>
             <map:serialize/>
           </map:act>
           <map:generate type="serverpages" src="docs/cerca-operaz.xsp"/>
           <map:transform src="stylesheets/apache.xsl"/>
           <map:serialize/>
          </map:match>

          <map:match pattern="protected/cerca-operaz.xml">
            <map:act set="process">
              <map:parameter name="descriptor" value="context://riskIdem/docs/operaz-form.xml"/>
              <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
              <map:serialize type="xml"/>
            </map:act>
            <map:generate type="serverpages" src="docs/cerca-operaz.xsp"/>
            <map:serialize type="xml"/>
          </map:match>
        </map:act>


        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ========================================= -->
      <!-- Logout link which invalidates the session -->
      <!-- ========================================= -->
      <map:match pattern="do-logout">
        <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/> 

          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
    </map:pipeline>

    <map:pipeline internal-only="true">
      <!-- This is the authentication resource -->
      <map:match pattern="authenticate">
        <map:generate src="docs/userlist.xml"/>
        <map:transform src="stylesheets/authenticate.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/>
      </map:match>


   <map:handle-errors>
    <map:transform src="stylesheets/system/error2document.xsl"/>
    <map:transform src="stylesheets/apache.xsl"/>
    <map:serialize status-code="500"/>
   </map:handle-errors>

  </map:pipeline>
 </map:pipelines>

</map:sitemap>

>-- Original Message --
>Reply-To: users@cocoon.apache.org
>Date: Sat, 24 Jan 2004 03:43:05 +0100
>From: Joerg Heinicke <jo...@gmx.de>
>To:  users@cocoon.apache.org
>Subject: Re: problem with authentication
>
>
>On 23.01.2004 17:57, Morley Howell wrote:

> Flavio,
> 
> Your sitemap looks a little odd. You have a matcher for 'protected', and
> then inside that matcher, you have another matcher for '*-operaz.html'.
If a
> URL matches the 'protected' patter
>, it cannot match the '*-operaz.html'
> pattern as well, so that chunk of your sitemap can never be reached.
> 
> This doesn't really explain why you're getting the resource not found
error,

It does as it is the error message "no pipeline matched
>request". It 
should probably be "protected/**".

Joerg

> but it might be a clue. What do the URLs for the links on your main menu
> look like?
> 
> Morley
> 
> 



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


Re: problem with authentication

Posted by Joerg Heinicke <jo...@gmx.de>.
On 23.01.2004 17:57, Morley Howell wrote:

> Flavio,
> 
> Your sitemap looks a little odd. You have a matcher for 'protected', and
> then inside that matcher, you have another matcher for '*-operaz.html'. If a
> URL matches the 'protected' pattern, it cannot match the '*-operaz.html'
> pattern as well, so that chunk of your sitemap can never be reached.
> 
> This doesn't really explain why you're getting the resource not found error,

It does as it is the error message "no pipeline matched request". It 
should probably be "protected/**".

Joerg

> but it might be a clue. What do the URLs for the links on your main menu
> look like?
> 
> Morley
> 
> 
>>-----Original Message-----
>>From: Flavio Palumbo [mailto:flavio.palumbo@fastwebnet.it]
>>Sent: Friday January 23, 2004 6:27 AM
>>To: users@cocoon.apache.org
>>Subject: RE: problem with authentication
>>
>>
>>sorry for the first post,
>>the handler name was wrong, this should be better but the problem is the
>>same.
>>thanks
>>Flavio
>>
>>
>>
>>hi all,
>>
>>i try to insert the authentication-fw example in my sitemap with no luck
>>; i'am able to start with the login page and authenticate me but when i
>>get my main menu every link i choose i always get "resource not found no
>>pipeline matched req
>>
>>>est".
>>
>>i'm sure this is a newbie mistake but can't find where is.
>>
>>can somebody help me ?
>>
>>thanks a lot
>>
>>Flavio
>>
>><!-- =========================== Pipelines
>>=================================
>>-->
>>
>> <map:pipelines>
>>
>>    <map:component-confi
>>
>>>urations>
>>
>>      <authentication-manager>
>>        <handlers>
>>          <handler name="protArea">
>>            <redirect-to uri="cocoon:/login"/>
>>            <authentication uri="cocoon:raw:/authenticate"/>
>>          </handler>
>>        </handlers>
>>
>>> </authentication-manager>
>>
>>    </map:component-configurations>
>>
>>    <map:pipeline>
>>
>>      <map:match pattern="">
>>        <map:redirect-to uri="login"/>
>>      </map:match>
>>
>>      <!-- ================= -->
>>      <!-- Simple login page -->
>>
>>>  <!-- ================= -->
>>
>>      <map:match pattern="login">
>>        <!-- if we are already logged in, redirect to the
>>protected document
>>-->
>>        <map:act type="auth-loggedIn">
>>          <map:parameter name="handler" value="protArea"/>
>>
>>>     <map:redirect-to uri="protected"/>
>>
>>        </map:act>
>>        <map:generate src="docs/login.xml"/>
>>        <map:transform src="stylesheets/simple-page2html.xsl"/>
>>        <map:transform type="encodeURL"/>
>>        <map:serialize/>
>>      </ma
>>
>>>:match>
>>
>>      <!-- ========================================= -->
>>      <!-- Form target which performs auth service   -->
>>      <!-- ========================================= -->
>>      <map:match pattern="do-login">
>>        <!-- try to login -->
>>
>>        <map:act type="auth-login">
>>          <map:parameter name="handler" value="protArea"/>
>>          <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>
>>
>>      <!-- ================ -->
>>      <!-- Protected area   -->
>>      <!-- ================ -->
>>      <map:match pattern="protected">
>>
>>><map:act type="auth-protect">
>>
>>          <map:parameter name="handler" value="protArea"/>
>>
>>            <map:generate src="docs/home.xml"/>
>>            <map:transform type="session"/>
>>            <map:transform src="stylesheets/apache.xsl"/>
>>
>>>     <map:transform type="encodeURL"/>
>>
>>            <map:serialize/>
>>
>>          <map:match pattern="*-operaz.html">
>>           <map:act set="process">
>>             <map:parameter name="descriptor"
>>value="context://riskIdem/docs/operaz-form.xml"/>
>>
>>>            <map:generate type="serverpages"
>>
>>src="docs/conferma-operaz.xsp"/>
>>             <map:transform src="stylesheets/apache.xsl"/>
>>             <map:serialize/>
>>           </map:act>
>>           <map:generate type="serverpages" src="docs/{1}-
>>
>>>peraz.xsp"/>
>>
>>           <map:transform src="stylesheets/apache.xsl"/>
>>           <map:serialize/>
>>          </map:match>
>>
>>          <map:match pattern="*-operaz.xml">
>>            <map:act set="process">
>>              <map:parameter name="descrip
>>
>>>or" value="context://riskIdem/docs/operaz-form.xml"/>
>>
>>              <map:generate type="serverpages"
>>src="docs/conferma-operaz.xsp"/>
>>              <map:serialize type="xml"/>
>>            </map:act>
>>            <map:generate type="serverpages" src=
>>
>>>docs/{1}-operaz.xsp"/>
>>
>>            <map:serialize type="xml"/>
>>          </map:match>
>>        </map:act>
>>
>>
>>        <!-- something was wrong, redirect to login page -->
>>        <map:redirect-to uri="login"/>
>>      </map:match>
>>
>>      <!-- ====
>>
>>>==================================== -->
>>
>>      <!-- Logout link which invalidates the session -->
>>      <!-- ========================================= -->
>>      <map:match pattern="do-logout">
>>        <map:act type="auth-protect">
>>          <map:p
>>
>>>rameter name="handler" value="protArea"/>
>>
>>          <map:act type="auth-logout"/>
>>        </map:act>
>>        <map:redirect-to uri="login"/>
>>      </map:match>
>>    </map:pipeline>
>>
>>    <map:pipeline internal-only="true">
>>      <!-- This is the
>>
>>>authentication resource -->
>>
>>      <map:match pattern="authenticate">
>>        <map:generate src="docs/userlist.xml"/>
>>        <map:transform src="stylesheets/authenticate.xsl">
>>          <map:parameter name="use-request-parameters" value="true"/>
>>
>>>     </map:transform>
>>
>>        <map:serialize type="xml"/>
>>      </map:match>
>>
>>
>>   <map:handle-errors>
>>    <map:transform src="stylesheets/system/error2document.xsl"/>
>>    <map:transform src="stylesheets/apache.xsl"/>
>>    <map:serialize status-
>>
>>>ode="500"/>
>>
>>   </map:handle-errors>
>>
>>  </map:pipeline>
>> </map:pipelines>
>>
>></map:sitemap>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional com
>>
>>>ands, 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
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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: problem with authentication

Posted by Morley Howell <mo...@cogeco.ca>.
Flavio,

Your sitemap looks a little odd. You have a matcher for 'protected', and
then inside that matcher, you have another matcher for '*-operaz.html'. If a
URL matches the 'protected' pattern, it cannot match the '*-operaz.html'
pattern as well, so that chunk of your sitemap can never be reached.

This doesn't really explain why you're getting the resource not found error,
but it might be a clue. What do the URLs for the links on your main menu
look like?

Morley

> -----Original Message-----
> From: Flavio Palumbo [mailto:flavio.palumbo@fastwebnet.it]
> Sent: Friday January 23, 2004 6:27 AM
> To: users@cocoon.apache.org
> Subject: RE: problem with authentication
>
>
> sorry for the first post,
> the handler name was wrong, this should be better but the problem is the
> same.
> thanks
> Flavio
>
>
>
> hi all,
>
> i try to insert the authentication-fw example in my sitemap with no luck
> ; i'am able to start with the login page and authenticate me but when i
> get my main menu every link i choose i always get "resource not found no
> pipeline matched req
> >est".
>
> i'm sure this is a newbie mistake but can't find where is.
>
> can somebody help me ?
>
> thanks a lot
>
> Flavio
>
> <!-- =========================== Pipelines
> =================================
> -->
>
>  <map:pipelines>
>
>     <map:component-confi
> >urations>
>       <authentication-manager>
>         <handlers>
>           <handler name="protArea">
>             <redirect-to uri="cocoon:/login"/>
>             <authentication uri="cocoon:raw:/authenticate"/>
>           </handler>
>         </handlers>
>
> >  </authentication-manager>
>     </map:component-configurations>
>
>     <map:pipeline>
>
>       <map:match pattern="">
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <!-- ================= -->
>       <!-- Simple login page -->
>
> >   <!-- ================= -->
>       <map:match pattern="login">
>         <!-- if we are already logged in, redirect to the
> protected document
> -->
>         <map:act type="auth-loggedIn">
>           <map:parameter name="handler" value="protArea"/>
>
> >      <map:redirect-to uri="protected"/>
>         </map:act>
>         <map:generate src="docs/login.xml"/>
>         <map:transform src="stylesheets/simple-page2html.xsl"/>
>         <map:transform type="encodeURL"/>
>         <map:serialize/>
>       </ma
> >:match>
>
>       <!-- ========================================= -->
>       <!-- Form target which performs auth service   -->
>       <!-- ========================================= -->
>       <map:match pattern="do-login">
>         <!-- try to login -->
> >
>         <map:act type="auth-login">
>           <map:parameter name="handler" value="protArea"/>
>           <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>
>
>       <!-- ================ -->
>       <!-- Protected area   -->
>       <!-- ================ -->
>       <map:match pattern="protected">
>
> > <map:act type="auth-protect">
>           <map:parameter name="handler" value="protArea"/>
>
>             <map:generate src="docs/home.xml"/>
>             <map:transform type="session"/>
>             <map:transform src="stylesheets/apache.xsl"/>
>
> >      <map:transform type="encodeURL"/>
>             <map:serialize/>
>
>           <map:match pattern="*-operaz.html">
>            <map:act set="process">
>              <map:parameter name="descriptor"
> value="context://riskIdem/docs/operaz-form.xml"/>
>
> >             <map:generate type="serverpages"
> src="docs/conferma-operaz.xsp"/>
>              <map:transform src="stylesheets/apache.xsl"/>
>              <map:serialize/>
>            </map:act>
>            <map:generate type="serverpages" src="docs/{1}-
> >peraz.xsp"/>
>            <map:transform src="stylesheets/apache.xsl"/>
>            <map:serialize/>
>           </map:match>
>
>           <map:match pattern="*-operaz.xml">
>             <map:act set="process">
>               <map:parameter name="descrip
> >or" value="context://riskIdem/docs/operaz-form.xml"/>
>               <map:generate type="serverpages"
> src="docs/conferma-operaz.xsp"/>
>               <map:serialize type="xml"/>
>             </map:act>
>             <map:generate type="serverpages" src=
> >docs/{1}-operaz.xsp"/>
>             <map:serialize type="xml"/>
>           </map:match>
>         </map:act>
>
>
>         <!-- something was wrong, redirect to login page -->
>         <map:redirect-to uri="login"/>
>       </map:match>
>
>       <!-- ====
> >==================================== -->
>       <!-- Logout link which invalidates the session -->
>       <!-- ========================================= -->
>       <map:match pattern="do-logout">
>         <map:act type="auth-protect">
>           <map:p
> >rameter name="handler" value="protArea"/>
>
>           <map:act type="auth-logout"/>
>         </map:act>
>         <map:redirect-to uri="login"/>
>       </map:match>
>     </map:pipeline>
>
>     <map:pipeline internal-only="true">
>       <!-- This is the
> >authentication resource -->
>       <map:match pattern="authenticate">
>         <map:generate src="docs/userlist.xml"/>
>         <map:transform src="stylesheets/authenticate.xsl">
>           <map:parameter name="use-request-parameters" value="true"/>
>
> >      </map:transform>
>         <map:serialize type="xml"/>
>       </map:match>
>
>
>    <map:handle-errors>
>     <map:transform src="stylesheets/system/error2document.xsl"/>
>     <map:transform src="stylesheets/apache.xsl"/>
>     <map:serialize status-
> >ode="500"/>
>    </map:handle-errors>
>
>   </map:pipeline>
>  </map:pipelines>
>
> </map:sitemap>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional com
> >ands, 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
>


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


RE: problem with authentication

Posted by Flavio Palumbo <fl...@fastwebnet.it>.
sorry for the first post, 
the handler name was wrong, this should be better but the problem is the
same.
thanks
Flavio



hi all,

i try to insert the authentication-fw example in my sitemap with no luck
; i'am able to start with the login page and authenticate me but when i
get my main menu every link i choose i always get "resource not found no
pipeline matched req
>est".

i'm sure this is a newbie mistake but can't find where is.

can somebody help me ?

thanks a lot

Flavio

<!-- =========================== Pipelines =================================
-->

 <map:pipelines>

    <map:component-confi
>urations>
      <authentication-manager>
        <handlers>
          <handler name="protArea">
            <redirect-to uri="cocoon:/login"/>
            <authentication uri="cocoon:raw:/authenticate"/>
          </handler>
        </handlers>
   
>  </authentication-manager>
    </map:component-configurations>

    <map:pipeline>

      <map:match pattern="">
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ================= -->
      <!-- Simple login page -->
  
>   <!-- ================= -->
      <map:match pattern="login">
        <!-- if we are already logged in, redirect to the protected document
-->
        <map:act type="auth-loggedIn">
          <map:parameter name="handler" value="protArea"/>
   
>      <map:redirect-to uri="protected"/>
        </map:act>
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/simple-page2html.xsl"/>
        <map:transform type="encodeURL"/>
        <map:serialize/>
      </ma
>:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <map:match pattern="do-login">
        <!-- try to login -->
>
        <map:act type="auth-login">
          <map:parameter name="handler" value="protArea"/>
          <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>

      <!-- ================ -->
      <!-- Protected area   -->
      <!-- ================ -->
      <map:match pattern="protected">
      
> <map:act type="auth-protect">
          <map:parameter name="handler" value="protArea"/>

            <map:generate src="docs/home.xml"/>
            <map:transform type="session"/>
            <map:transform src="stylesheets/apache.xsl"/>
     
>      <map:transform type="encodeURL"/>
            <map:serialize/>

          <map:match pattern="*-operaz.html">
           <map:act set="process">
             <map:parameter name="descriptor" value="context://riskIdem/docs/operaz-form.xml"/>

>             <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
             <map:transform src="stylesheets/apache.xsl"/>
             <map:serialize/>
           </map:act>
           <map:generate type="serverpages" src="docs/{1}-
>peraz.xsp"/>
           <map:transform src="stylesheets/apache.xsl"/>
           <map:serialize/>
          </map:match>

          <map:match pattern="*-operaz.xml">
            <map:act set="process">
              <map:parameter name="descrip
>or" value="context://riskIdem/docs/operaz-form.xml"/>
              <map:generate type="serverpages" src="docs/conferma-operaz.xsp"/>
              <map:serialize type="xml"/>
            </map:act>
            <map:generate type="serverpages" src=
>docs/{1}-operaz.xsp"/>
            <map:serialize type="xml"/>
          </map:match>
        </map:act>


        <!-- something was wrong, redirect to login page -->
        <map:redirect-to uri="login"/>
      </map:match>

      <!-- ====
>==================================== -->
      <!-- Logout link which invalidates the session -->
      <!-- ========================================= -->
      <map:match pattern="do-logout">
        <map:act type="auth-protect">
          <map:p
>rameter name="handler" value="protArea"/>

          <map:act type="auth-logout"/>
        </map:act>
        <map:redirect-to uri="login"/>
      </map:match>
    </map:pipeline>

    <map:pipeline internal-only="true">
      <!-- This is the
>authentication resource -->
      <map:match pattern="authenticate">
        <map:generate src="docs/userlist.xml"/>
        <map:transform src="stylesheets/authenticate.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
 
>      </map:transform>
        <map:serialize type="xml"/>
      </map:match>


   <map:handle-errors>
    <map:transform src="stylesheets/system/error2document.xsl"/>
    <map:transform src="stylesheets/apache.xsl"/>
    <map:serialize status-
>ode="500"/>
   </map:handle-errors>

  </map:pipeline>
 </map:pipelines>

</map:sitemap>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional com
>ands, 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