You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Wirz <mi...@abs.de> on 2005/01/11 18:32:31 UTC

authentification-fw; intermediate login page

Hello Coocon-Users!

I am building a cocoon application based on 2.1.
I'd like to protect some of the pages by login/pw. As I learned from the 
examples
of the authentication-fw, it is possible to protect pages by actions. This
works well and I embedded it to my sitemap.

On an not yet authenticated "auth-protect" a redirect to the login-page
happens. Wonderful. After successful login a redirect to a predefined 
static page
takes place, as in the snippet below:

(this is from authentication-fw example)

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <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:username}"/>
          <map:redirect-to uri="protected"/>
          <WHAT I NEED HERE: MAGIC TAG TO EXCTRACT A REMEBERED URL TO 
REDIRECT TO>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

But I'd like to have the sitemap remember which URL the user requested.
After having logged in he/she should be redirected to exact that page 
that was
requested, not -- as in the example -- to a static page.

This snippet -- as I guess -- has to be modified to remember the 
requested URL:

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

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


Since I am relatively new to the new cocoon (i used 1.8 for quite a 
while, but - WOW -
so much things changed in a powerful way) I'd kindly appreciate any hints.

Thanks in advance,
Michael Wirz

-- 
abs IT Service GmbH
Ein Unternehmen der abs Gruppe
Michael Wirz
Entwicklung

Landsberger Straße 57
82266 Stegen am Ammersee

Telefon: +49-(0)8143-999-43
Telefax: +49-(0)8143-999-49

michael.wirz@abs.de
www.eFonds24.de


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


Re: authentification-fw; intermediate login page

Posted by Michael Wirz <mi...@abs.de>.
Hi List, hi Jens,

thanks, thats exactly what I needed.
BTW: Where do I find all a list of all these {xyz}-variables that are
automatically built in? I suppose there are many powerful little tools
at my fingertips using stuff like that.
Is it possible to access session-attributes in this way?

Please point my to the appropriate doc if this is obviously RTFM.

Thank you,
Michael

>Hi,
>
>  
>
>>But I'd like to have the sitemap remember which URL the user requested.
>>After having logged in he/she should be redirected to exact that page
>>that was
>>requested, not -- as in the example -- to a static page.
>>    
>>
>
>iirc the auth-action adds a request parameter to the login-url:
>e.g.: login?resource=rederictedFromHere
>
>you can do something like this then:
>
><map:match pattern="login">
><map:act type="auth-login">
><map:parameter name="handler" value="insurance"/>
><map:parameter name="parameter_userid" value="{request-param:name}"/>
><map:parameter name="parameter_password" value="{request-param:password}"/>
>--> <map:redirect-to uri="{request-param:resource}"/>  <-- redirects
>to the resource specified in the reqest param 'resource'
>
></map:act>
><map:generate src="content/login.xml"/>
><map:transform src="context:/resources/styles/svm-admin-style.xsl"/>
><map:serialize type="html"/>
></map:match>
>
>hth
>
>  
>


-- 
abs IT Service GmbH
Ein Unternehmen der abs Gruppe
Michael Wirz
Entwicklung

Landsberger Straße 57
82266 Stegen am Ammersee

Telefon: +49-(0)8143-999-43
Telefax: +49-(0)8143-999-49

michael.wirz@abs.de
www.eFonds24.de


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


Re: authentification-fw; intermediate login page

Posted by Jens Maukisch <co...@maukisch.net>.
Hi,

> But I'd like to have the sitemap remember which URL the user requested.
> After having logged in he/she should be redirected to exact that page
> that was
> requested, not -- as in the example -- to a static page.

iirc the auth-action adds a request parameter to the login-url:
e.g.: login?resource=rederictedFromHere

you can do something like this then:

<map:match pattern="login">
<map:act type="auth-login">
<map:parameter name="handler" value="insurance"/>
<map:parameter name="parameter_userid" value="{request-param:name}"/>
<map:parameter name="parameter_password" value="{request-param:password}"/>
--> <map:redirect-to uri="{request-param:resource}"/>  <-- redirects
to the resource specified in the reqest param 'resource'

</map:act>
<map:generate src="content/login.xml"/>
<map:transform src="context:/resources/styles/svm-admin-style.xsl"/>
<map:serialize type="html"/>
</map:match>

hth

-- 
* best regards
* Jens Maukisch              


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