cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Authentication failed
Date Thu, 26 Feb 2004 16:53:31 GMT
On February 26, 2004, Jean-Luc wrote:

> Now, I would like to access from 'index.xsp' the tag 'data' which is 
> by my Authenticator, in order to display a message in the result HTML 
page. Is
> anybody knows how to do that ? I've tried with session context but with 
> success ...

Hi Jean-Luc,

If I understand correctly, you're asking how to pass a failure message 
back to a login screen.  When you set your authentication as:


you've indicated to cocoon that the authentication failed.  So, this does 
NOT in fact get stored in the session context, but is available in the 
temporary context while still in the authentication pipeline.  In the part 
of you pipeline, you can access the temporary context.

I personally have my login form running a simple XML file through an xslt. 
 The XML file simply contains:

<?xml version="1.0" encoding="UTF-8"?>
<login xmlns:session="">
                <session:getxml context="temporary" path="/"/>

which gets run through this pipeline:

 <map:match pattern="login.html">
   <map:generate src="docs/login/login.xml"/>
   <map:transform type="session"/>
   <map:transform src="stylesheets/login/login.xslt"/>
   <map:transform type="augment"/>
   <map:serialize type="xhtml"/>

which assures me that each time the login form is pulled up (including 
when a login failure occurs), my form has access to the temporary context. 
 Which, in my case, I put the error as:

                <error>Error Message</error>

so my login.xml winds up presenting to login.xslt:

                        <error>Error Message</error>

In your case:

>    <map:match pattern="login">
>     <map:act type="auth-login">
>      <map:parameter name="handler" value="rb-handler"/>
>      <map:parameter name="parameter_login" 
>      <map:parameter name="parameter_passwd" 
>      <map:redirect-to uri="success.xsp"/>
>     </map:act>
>     <!-- Login has failed -->
>     <map:generate src="pages/logic/index.xsp"/>
>     <map:transform src="pages/stylesheet/index.xsl"/>
>     <map:serialize/>
>    </map:match>

You should be able to access your error message in index.xsp using the 
temporary context.

Please see:

If the authentication fails, the action does not deliver a map and 
therefore the commands inside the map:act are skipped. The error 
information delivered by the authentication resource is stored into the 
temporary context. So you can get the information using either the session 
transformer or the session-context input module.


David Day

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message