You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew MacDonald <an...@yahoo.com> on 2004/09/23 17:40:54 UTC

Re: Problem accessing authentication session in portal sitemap

Yes, of course.  I should've done that in the original
post, sorry.

Here's the authentication part where the skin variable
is added (from user-data-test.xml):

<map:pipeline internal-only="true">
	<map:match pattern="sunrise-authuser">
        <map:aggregate element="auth">
            <map:part
src="resources/sunrise-user.xml"/>
            <map:part
src="resources/user-data-test.xml"/>
        </map:aggregate>
        <map:transform src="styles/authenticate.xsl">
            <map:parameter
name="use-request-parameters" value="true"/>
        </map:transform>
        <map:serialize type="xml"/>
...

Here's the authentication context:

<authentication>
<ID>anonymous</ID>
<role>guest</role>
<data>
<user>anonymous</user>
</data>
<skin>minimal</skin>
<type>cocoon.authentication</type>
<media>html</media>
</authentication>

Later on, in the main pipeline I have this:

<map:match pattern="css/*.css">
    <map:act type="auth-protect">
	<map:parameter name="handler"
value="portal-handler"/>
    	<map:read mime-type="text/css"
src="skins/{skin}/css/{1}.css"/>
    </map:act>
</map:match>

I realized after I posted that to access the
authentication context I need the auth-protect act. 
However, now that I've added it, it doesn't seem to
access that code at all.  For example, even if I
hardcode the skin directory, it still doesn't work. 
Instead of {skin} I've also tried
{session-context:authentication/authentication/skin}
but that doesn't work either.

Thanks for any help,
Andrew


> Could you please provide us with relevant parts of >
your
> sitemap?
>
> TIA,
> -- 
> Jean-Baptiste Quenot
> Anyware Technologies
> http://www.anyware-tech.com/




		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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


Re: Problem accessing authentication session in portal sitemap

Posted by Jean-Baptiste Quenot <jb...@anyware-tech.com>.
* Andrew MacDonald:
> Later on, in the main pipeline I have this:
> 
> <map:match pattern="css/*.css">
>     <map:act type="auth-protect">
> 	<map:parameter name="handler"
> value="portal-handler"/>
>     	<map:read mime-type="text/css"
> src="skins/{skin}/css/{1}.css"/>
>     </map:act>
> </map:match>

If the user is not logged in, how do you expect the CSS to be loaded?
You could maybe have an unprotected pipeline for anonymous user, or
match the skin name directly in the pattern.  AFAICT, auth-protect is
not appropriate for resources like CSS.  You could also use <map:act
type="auth-loggedIn"> to check whether the user is logged in before
reading the CSS.

HTH,
-- 
Jean-Baptiste Quenot
Anyware Technologies
http://www.anyware-tech.com/

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