You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Z.Z." <za...@vili.pmmf.hu> on 2004/02/24 21:16:02 UTC

Re: I don ´t understand authentication of multiple documents

Hello,
Many thanks to you it works well :-)

2004. február 24. 18.27 dátummal DAYD3@Nationwide.com ezt írta:
> On February 24, 2004, at 11:22 AM, Zamek wrote:
> > Action of my forms send a request to do-login with username, and if it
> > successful it redirect to a predefined uri:
> >
> >   <map:match pattern="do-login">
> >       <!-- try to login -->
> >       <map:act type="auth-login">
> >         <map:parameter name="handler" value="portalhandler"/>
> >         <map:parameter name="parameter_name"
> >              value="{request-param:username}"/>
> >
> >         <map:redirect-to uri="protected"/>   <----------- here is a
> >                                         predefined redirect address
> >
> >       </map:act>
> >       <map:redirect-to uri="login"/>
> >    </map:match>
> >
> > How can I redirect it to the correct uri which was requested like
> > protected-*?
>
> When your auth-protect is enacted, and it winds up redirecting to your
> login form (in your case, http://someserver/context/login), it should
> also receive a variable via GET called 'resource'.  Make sure your
> 'login' form captures this and returns it to your login action (in your
> case, http://someserver/context/do-login).  This variable contains the
> originally requested uri, and if you capture and pass it through, you can
> then change your sitemap as such:
>
> <map:match pattern="do-login">
>  <map:act type="auth-login">
>   <map:parameter name="handler" value="portalhandler"/>
>   <map:parameter name="parameter_name" value="{request-param:username}"/>
>   <map:redirect-to uri="{request-param:resource}"/>
>  </map:act>
>  <map:redirect-to uri="login"/>
> </map:match>
>
> Upon successfully logging in, your user will automatically go to the
> resource they originally requested.
>
> HTH!
>
> Thanks!
> David Day
>
>
>
>
> Zamek <za...@vili.pmmf.hu>
>
>
>
>
> 02/24/2004 11:22 AM
> Please respond to users
>
>
> T
> To:     <us...@cocoon.apache.org>
> cc:
>
> bcc:
> Subject:        I don´t understand authentication of multiple documents
>
>
> Hello All,
>
> Single document protection is working well, but I need to protect a lot
> of
>
> documents:
>
>   <map:match pattern="protected-*">
>      <map:act type="auth-protect">
>        <map:parameter name="handler" value="portalhandler"/>
>
>        <map:match pattern="protected-*.pdf">
>           <map:read mime-type="application/pdf" src="{1}.pdf"/>
>           <map:transform type="session"/>
>        </map:match>
>
>      </map:act>
>      <!-- something was wrong, redirect to login page -->
>      <map:redirect-to uri="login"/>
>    </map:match>
>
> Action of my forms send a request to do-login with username, and if it
> successful it redirect to a predefined uri:
>
>   <map:match pattern="do-login">
>       <!-- try to login -->
>       <map:act type="auth-login">
>         <map:parameter name="handler" value="portalhandler"/>
>         <map:parameter name="parameter_name"
> value="{request-param:username}"/>
>
>         <map:redirect-to uri="protected"/>   <----------- here is a
> predefined redirect address
>
>       </map:act>
>       <map:redirect-to uri="login"/>
>    </map:match>
>
> How can I redirect it to the correct uri which was requested like
> protected-*?

-- 
udv,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


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