Wellt; in the archives, folk say it cannot be done directly:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110770040906053&w=2
What you can do is store the the authentication data
in another session-context:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108996219132467&w=2
Should have searched the archives, first (sorry).
Quick summary for the browsing impaired:
1. Add action type:
<map:components>
...
<map:actions>
<map:action logger="sitemap.action.session-propagator"
name="session-propagator"
src="org.apache.cocoon.acting.SessionPropagatorAction"/>
<map:action logger="sitemap.action.request-param" name="request-param"
src="org.apache.cocoon.acting.RequestParamAction"/>
</map:actions>
</map:components>
2. Store the authentication data you want directly after
login eg, userID (ID) or username or tag:
<map:match pattern="docs/do-login">
<!-- try to login -->
<map:act type="auth-login">
<map:parameter name="handler" value="bvochandler"/>
<map:parameter name="parameter_name" value="{request-param:name}"/>
<map:parameter name="parameter_password" value="{request-param:password}"/>
<!-- keep info in session -->
<map:act type="session-propagator">
<map:parameter name="userid" value="{ID}"/>
</map:act>
<map:redirect-to uri="show-project.htm"/>
</map:act>
<!-- something was wrong, try it again -->
<map:redirect-to uri="login"/>
</map:match>
3. In a pipeline, pass the info to the stylesheet in the form of
a parameter eg.
<map:transform src="stylesheets/page2html.xsl">
<map:parameter name="use-request-parameters" value="true"/>
<map:parameter name="userid" value="{session-attr:userid}"/>
HTH.
>>> [EMAIL PROTECTED] 2006/01/25 08:38 AM >>>
Hans
I feel sure there must be *some* way to make that info
available to the rest of the sitemap?
Derek
>>> [EMAIL PROTECTED] 2006/01/24 05:38 PM >>>
I might be wrong, but I think that is only
available inside <map:act type="auth-protect"></map:act>
Regards
Hans
On 1/24/06, Derek Hohls < [EMAIL PROTECTED] > wrote:
> I am trying to obtain authentication data inside and outside of protected
> pipeline.
>
> INSIDE the pipeline I have :
>
> <map:match pattern="docs/show-**">
> <map:act type="auth-protect">
> <map:parameter name="handler" value="myhandler"/>
>
> <map:match pattern="docs/show-protected">
> <map:generate src="docs/protected.xml"/>
> <map:transform type="session"/>
> <map:transform src="stylesheets/page.xsl">
> <map:parameter name="userid"
> value="{session-context:authentication/authentication/ID}"/>
> </map:transform>
> <map:serialize/>
> </map:match>
>
> And this works OK (I can obtain "userid").
>
> OUTSIDE the pipeline I have :
>
> <map:match pattern="docs/*.htm">
> <map:generate src="docs/{1}.xml"/>
> <map:call resource="page2html"/>
> <map:serialize type="html"/>
> </map:match>
>
> and in the resource section:
>
> <map:resources>
> <map:resource name="page2html">
> <map:transform src="stylesheets/page.xsl">
> <map:parameter name="userid" value="{ID}"/>
> <!-- HAVE ALSO TRIED
> <map:parameter name="userid"
> value="{session-context:/authentication/authentication/ID}"/>
> <map:parameter name="userid" value="{session-attr:ID}"/>
> -->
> </map:transform>
> </map:resource>
> </map:resources>
>
> But this does not work after the user has logged in?
>
> What is the correct method for obtaining authentication data
> outside of a protected pipeline?
>
> Thanks
> Derek
--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]