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 <[EMAIL PROTECTED]>




02/24/2004 11:22 AM
Please respond to users

 
T
To:     <[EMAIL PROTECTED]>
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-*?
 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to