cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WeeZard" <weez...@email.si>
Subject Re: Auth-fw, can't get Session context
Date Thu, 19 May 2005 07:52:25 GMT
I had the same problem, just yesterday, and I found out, that in order the 
session to work, you have to wrap (every request) pipeline auth-protect 
action, like this (see 
http://cocoon.apache.org/2.1/developing/webapps/authentication.html):

<map:act type="auth-protect">
    <map:parameter name="handler" value="your-handler"/>
     ... your pipeline ...
</map:act>

around every pipeline that uses authentication context (I think internal 
pipelines don't need to be wraped).
Don't forget to wrap your continuation pipeline, like this:

<map:match pattern="*.continue">
    <map:act type="auth-protect">
        <map:parameter name="handler" value="auth-handler"/>
        <map:call continuation="{../1}"/>
    </map:act>
</map:match>

Of course, you will have to have 2 continuation pipelines, one for protected 
and one for unprotected cform pages.

Hope it helps

Weez



----- Original Message ----- 
From: "Stavros Kounis" <skounis@gmail.com>
To: <users@cocoon.apache.org>
Sent: Thursday, May 19, 2005 8:06 AM
Subject: Auth-fw, can't get Session context


hi all

i try to use Auth-FW. i have choose to create one just like the flow
based in cocoon's samples.

The auth process work fine (i can login log-out etc) but i can not get
loged-in user's information.

I have try the code snippet from AuthFWWithFlow wiki page [1]

....
var contextMan =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
var authContext = contextMan.getContext("authentication");
var userFrag = authContext.getXML("/authentication/ID");
var username = 
Packages.org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(userFrag);
...

this code return NULL at contextMan.getContext("authentication").

I have to note that when i add this snippet at original cocoon's
sample work fine.

Did anyone give me a hint where i have to look for?

Is it possible in my case context name to be different than
"authentication" or is something else i miss?

regards
--stavros


[1]: http://wiki.apache.org/cocoon/AuthFWWithFlow
-- 
Stavros Kounis                        Osmosis networks & consulting
http://tools.osmosis.gr/blog          http://www.osmosis.gr

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


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


Mime
View raw message