Hi Sonny,

Your anwser would work if it was after a successfull authentication ;)...
But no session is created when the authentication fails.

And as I wrote, the sitemap needs a Generator before using a Transformer.
That's the problem :)
--
Olivier


On 20/08/2003 19:49, Sonny Sukumar wrote:



Hi Olivier,


The docs say to use the session transformer with tags like these:

<session:getxml context="authentication" path="/authentication/ID"/> <!-- Get the ID -->
<session:getxml context="authentication" path="/authentication/data/username"/>


These tags will get transformed into (substituted with) the data content, or whatever content you specify in the Xpath-like expression in the "path" attribute (see above).

The doc I'm referring to is here:
http://cocoon.apache.org/2.1/developing/webapps/authentication.html

Hth,

Sonny

From: Olivier Billard <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: 3 questions...
Date: Wed, 20 Aug 2003 15:06:00 +0200

Hi Andrew,

I have a little question about retrieving the "data" tag content.
How could you get the content ? It seems that there is no corresponding output module, and when I set a serializer instead of the classic <map:redirect-to uri="login"/> to view the <data> content, I have the following error :
"You must set a generator first before you can use a serializer."
So how can you access the data content ?


Thanks,
--
Olivier



On 20/08/2003 09:21, Andrew Timberlake wrote:

Sonny

Try walking the programming logic. Starting with org.apache.cocoon.webapps.authentication.acting.LoginAction
and follow how cocoon deals with each step of the process.


One thing to watch out for is when you get code such as manager.lookup(XXX.Role) this is referencing an Interface to which an implementation class has been assigned within cocoon.xconf. An easy way to identify the implementation class is to look for a class named in one of three common ways:
<NameOfInterface>Impl.java
Simple<NameOfInterface>.java
or
Default<NameOfInterface>.java
and then continue walking the logic. This is a great way to figure out how cocoon works internally which will help your use of cocoon considerably.


Sonny Sukumar wrote:

Andrew, thank you for your time and effort to find the info below for me...it *is* proving helpful. See couple questions below...

I'm not sure that a login tag is created. The temprary context should contain an XML fragment which looks like the following:
<authentication>
<failed/>
<data>Any error message which was set by your authentication handler</data>
</authentication>


This I get from reading the few lines above the SessionConstants.TEMPORARY_CONTEXT code I mentioned above.


Ahh, that's strange...the docs mention nothing about a <failed/> tag from what I read. Is this just a tagging element of some sort? I mean, is it just always an empty element that just signals the authentication failed?



I think it is just a flag. Remember that this block is providing a generic process for handling authentication. Any block will try to provide a solution for the common problem but you don't need to use it to solve the problem in the way it was written specifically.
Example is that you need not check for the failed element to know that the auth failed as the action will pass the processing onto your failed pipeline fragment in which case, you simply need to retrieve the content of the data element and continue.


Andrew



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
<b>MSN 8:</b> Get 6 months for $9.95/month. http://join.msn.com/?page=dept/dialup



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




-- Olivier BILLARD Société Jouve Tel : 33 2 99 86 93 55 Mail : [EMAIL PROTECTED]

Le présent mail ainsi que toutes les informations qu'il contient ne peuvent en aucun cas être considérés comme un engagement juridique de quelque nature que ce soit de JOUVE. Tout accord devra être formulé par écrit papier ultérieur signé par un représentant légal de JOUVE. Par ailleurs, si vous recevez ce mail par erreur, merci de nous le signaler et de le détruire ainsi que l'intégralité du document qui pourrait y être joint.

The present email and all information included therein do not constitute a legal agreement accorded by Jouve. All legal agreements must be formulated in writing on paper by a legal representative of JOUVE. If you have received this email by mistake, please inform us of that fact and destroy the email and any documents it might contain. Thank you for your cooperation.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to