cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: No "authentication" context?
Date Wed, 03 Sep 2003 09:02:11 GMT
The correct way to get the session context is to use
the context manager component from "org.apache.cocoon.webapps.session".

You have to lookup this component from the component manager,
get the context from the context manager and can then stream
the contents.

Carsten

> -----Original Message-----
> From: Paul Bowler [mailto:paulbowler@www.aventix.co.uk]
> Sent: Wednesday, September 03, 2003 10:50 AM
> To: users@cocoon.apache.org; users@cocoon.apache.org
> Subject: RE: No "authentication" context?
>
>
> I have just come back from holiday and, upon downloading the new
> 2.1 release, am having the same problem with some of
> my components.
>
> For example, I have a very simple session generator that takes
> the session data and throws it out as XML. The code
> that does this is:
>
> SessionContext context = (SessionContext)
> s.getAttribute("org.apache.cocoon.webapps.authentication.SessionContext");
> context.streamXML("/global/authentication", super.contentHandler,
> super.lexicalHandler);
> ...
>
> As you can see, this takes the 'SessionContext' object that is
> stored in the session and uses the 'streamXML' method
> to pass the data as XML to the next component in the pipeline.
>
> Since the official 2.1 release the
> 'org.apache.cocoon.webapps.authentication.SessionContext' session
> object/attribute
> has gone being replaced
> with
> 'org.apache.cocoon.webapps.authentication.components.DefaultAuthen
> ticationManager/UserStatus'. This is a
> different class and AFAICS is undocumented. ALL of my session
> components no longer work.
>
> Can anyone explain why this change was made and how to access the
> XML session data from within Java code.
>
> Many thanks,
>
> Paul.
>
>
>
>
> On Wed, 3 Sep 2003 09:53:10 +0200, Carsten Ziegeler wrote
> > Sonny Sukumar wrote:
> > >
> > >
> > > 1.) Upon authentication, I store the user's email address in the
> > > <ID> tag in
> > > the doc the auth resource returns.
> > > 2.) My assumption until this point has been that the "authentication"
> > > context is now created in the session and stays there until
> the user logs
> > > out.  Furthemore, I've assumed that I should be able to fetch
> the ID tag
> > > contents at any time while the user is logged in (the email
> > > address, in my
> > > case).
> > >
> > Yes, that's absolutely correct.
> >
> > > I'm now using auth-protect with the correct handler in the
> > > pipeline, but I
> > > still get the same error--context "authentication" can't be found.
> > >
> > Without further information, I can only say that it should work
> that way.
> >
> > You can have a look at the sample of the authentication block,
> the protected
> > pipeline there uses the session transformer to display the whole
> > authentication
> > context.
> >
> > Carsten
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
> --
> Paul Bowler
> Aventix Associates Ltd
>
> ---------------------------------------------------------------------
> 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