You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by apurva zaveri <az...@yahoo.com> on 2002/09/05 18:11:46 UTC

Redirect from sub-sitemap in authentication framework

Redirect from an sub-sitemap to the login page does
not seem to be working in authentication framework.

i.e

If you have a protected page in subsitemap.
The redirection in sub-sitemap (in case of not
authenticated) is not able to go to login page (in
sitemap)

      <map:match pattern="protected">
		<map:act type="auth-protect">
			<map:parameter name="handler" value="AuthHandler"/>

                <map:generate
src="docs/protected.xml"/>
                <map:transform
src="stylesheets/simple-page2html.xsl"/>
                <map:transform type="encodeURL"/>
                <map:serialize/>
            </map:act>
            <!-- something was wrong, redirect to
login page -->
            <map:redirect-to uri="../login"/>   <!--
this does not work even cocoon:/login does not work 
-->
      </map:match>

It look for login in the current sitemap.
But i fixed this problem this way:

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

      <map:match pattern="protected">
		<map:act type="auth-protect">
			<map:parameter name="handler" value="AuthHandler"/>

                <map:generate
src="docs/protected.xml"/>
                <map:transform
src="stylesheets/simple-page2html.xsl"/>
                <map:transform type="encodeURL"/>
                <map:serialize/>
            </map:act>
            <!-- something was wrong, redirect to
login page -->
            <map:redirect-to uri="login"/>
      </map:match>

Obvioulsy this is not a right way......... is it a bug
or am i going wrong somewhere?

-Apurva

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

---------------------------------------------------------------------
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>


RE: Redirect from sub-sitemap in authentication framework

Posted by Carsten Ziegeler <cz...@s-und-n.de>.

> -----Original Message-----
> From: apurva zaveri [mailto:azaveri@yahoo.com]
> Sent: Thursday, September 05, 2002 6:12 PM
> To: cocoon-users@xml.apache.org
> Subject: Redirect from sub-sitemap in authentication framework
> 
> 
> Redirect from an sub-sitemap to the login page does
> not seem to be working in authentication framework.
> 
> i.e
> 
> If you have a protected page in subsitemap.
> The redirection in sub-sitemap (in case of not
> authenticated) is not able to go to login page (in
> sitemap)
> 
>       <map:match pattern="protected">
> 		<map:act type="auth-protect">
> 			<map:parameter name="handler" value="AuthHandler"/>
> 
>                 <map:generate
> src="docs/protected.xml"/>
>                 <map:transform
> src="stylesheets/simple-page2html.xsl"/>
>                 <map:transform type="encodeURL"/>
>                 <map:serialize/>
>             </map:act>
>             <!-- something was wrong, redirect to
> login page -->
>             <map:redirect-to uri="../login"/>   <!--
> this does not work even cocoon:/login does not work 
> -->
>       </map:match>
> 
This map:redirect-to is never executed - if the auth-protect
action notices that the user is not logged in, it automatically
redirects to the login-in configuration of your handler.

HTH
Carsten

> It look for login in the current sitemap.
> But i fixed this problem this way:
> 
>       <map:match pattern="login">
>              <map:redirect-to uri="../login"/>
>       </map:match>
> 
>       <map:match pattern="protected">
> 		<map:act type="auth-protect">
> 			<map:parameter name="handler" value="AuthHandler"/>
> 
>                 <map:generate
> src="docs/protected.xml"/>
>                 <map:transform
> src="stylesheets/simple-page2html.xsl"/>
>                 <map:transform type="encodeURL"/>
>                 <map:serialize/>
>             </map:act>
>             <!-- something was wrong, redirect to
> login page -->
>             <map:redirect-to uri="login"/>
>       </map:match>
> 
> Obvioulsy this is not a right way......... is it a bug
> or am i going wrong somewhere?
> 
> -Apurva
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
> 
> ---------------------------------------------------------------------
> 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>
> 

---------------------------------------------------------------------
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>