You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by mi...@sonynetservices.com on 2002/09/25 13:51:14 UTC

authentication session context

Hello,

   we have the following problem:
   We have an application where we use the authentication framework for
login.
   At successful authentication we write the user data to the
authentication context.
   After the user is logged in we like to work with the stored data in the
session context like following:
   The user clicks a link  and we have to load information from a database.
   Therefore we wrote a generator which gets out the user information from
the authentication
    session context, queries the database and returns xml.
    This works fine as long as we are not using aggregation or the cocoon
Protocol.
   (we don´t really know in the moment where the problem lies).
   Here is the part of the sitemap:

   <map:pipeline>
      <map:act type="locale">
        <map:parameter name="parameters" value="true" />
        <map:act type="auth-protect">
          <map:parameter name="handler" value="loginhandler" />
          <map:match pattern="gallery.xml">
            <map:generate type="gallery" />
            <map:serialize type="xml" />
          </map:match>
          <map:match pattern="*.html">
            <map:aggregate element="inbox">
              <map:part src="cocoon:/gallery.xml" />
              <map:part src="WEB-INF/xml/{1}.xml" />
              <map:part src="WEB-INF/xml/userinbox.xml" />
              <map:part src="WEB-INF/xml/msapp.xml" />
<!--map:part src="WEB-INF/xml/gallery.xml" /-->
            </map:aggregate>
            <map:transform type="i18n">
              <map:parameter name="locale" value="{../locale}" />
              <map:parameter name="catalogue-name" value="{1}" />
            </map:transform>
            <map:transform src="WEB-INF/xsl/{1}.xsl">
              <map:parameter name="use-request-parameters" value="true" />
            </map:transform>
            <map:serialize />
          </map:match>
        </map:act>
      </map:act>
    </map:pipeline>

If we request gallery.xml after login from the browser everything works
fine.
If we try the same thing with the aggregation and the cocoon protocol, we
get an empty map
in our generator when doing:
AuthenticationManager.createMap();
meaning are not getting the data from the authentication session context.

Anybody tried something like this before - or is there a beter way to do
it?

Thanx again for any help,


miHam


---------------------------------------------------------------------
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: authentication session context

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
I think your problem is caused by this bug:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12293

Carsten

> -----Original Message-----
> From: michael_hampel@sonynetservices.com
> [mailto:michael_hampel@sonynetservices.com]
> Sent: Wednesday, September 25, 2002 1:51 PM
> To: cocoon-users@xml.apache.org
> Subject: authentication session context
>
>
> Hello,
>
>    we have the following problem:
>    We have an application where we use the authentication framework for
> login.
>    At successful authentication we write the user data to the
> authentication context.
>    After the user is logged in we like to work with the stored data in the
> session context like following:
>    The user clicks a link  and we have to load information from a
> database.
>    Therefore we wrote a generator which gets out the user information from
> the authentication
>     session context, queries the database and returns xml.
>     This works fine as long as we are not using aggregation or the cocoon
> Protocol.
>    (we don´t really know in the moment where the problem lies).
>    Here is the part of the sitemap:
>
>    <map:pipeline>
>       <map:act type="locale">
>         <map:parameter name="parameters" value="true" />
>         <map:act type="auth-protect">
>           <map:parameter name="handler" value="loginhandler" />
>           <map:match pattern="gallery.xml">
>             <map:generate type="gallery" />
>             <map:serialize type="xml" />
>           </map:match>
>           <map:match pattern="*.html">
>             <map:aggregate element="inbox">
>               <map:part src="cocoon:/gallery.xml" />
>               <map:part src="WEB-INF/xml/{1}.xml" />
>               <map:part src="WEB-INF/xml/userinbox.xml" />
>               <map:part src="WEB-INF/xml/msapp.xml" />
> <!--map:part src="WEB-INF/xml/gallery.xml" /-->
>             </map:aggregate>
>             <map:transform type="i18n">
>               <map:parameter name="locale" value="{../locale}" />
>               <map:parameter name="catalogue-name" value="{1}" />
>             </map:transform>
>             <map:transform src="WEB-INF/xsl/{1}.xsl">
>               <map:parameter name="use-request-parameters" value="true" />
>             </map:transform>
>             <map:serialize />
>           </map:match>
>         </map:act>
>       </map:act>
>     </map:pipeline>
>
> If we request gallery.xml after login from the browser everything works
> fine.
> If we try the same thing with the aggregation and the cocoon protocol, we
> get an empty map
> in our generator when doing:
> AuthenticationManager.createMap();
> meaning are not getting the data from the authentication session context.
>
> Anybody tried something like this before - or is there a beter way to do
> it?
>
> Thanx again for any help,
>
>
> miHam
>
>
> ---------------------------------------------------------------------
> 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>