cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: auth-loggedIn
Date Mon, 25 Apr 2005 12:15:38 GMT
Lionel Barth wrote:
> Hi,
> 
> I have posted a question about auth-loggedIn a few days ago.
> I received no answer, so I tried to find a solution by myself.
> 
> The point was I get an error message "User is already authenticated 
> using handler..." if I go twice through the login process in the 
> authentication-fw block.
> 
> I have change the source program "DefaultHandlerManager.java" lines 
> 198-200 :
> from :
>         // are we already logged in?
>         UserHandler handler = this.getUserHandler( handlerName );
>         if ( handler != null ) {
>             throw new ProcessingException("User is already authenticated 
> using handler: " + handlerName);
>         }
> 
> to
>         // are we already logged in?
>         UserHandler handler = this.getUserHandler( handlerName );
>         if ( handler == null ) {
> //        if ( handler != null ) {
> //            throw new ProcessingException("User is already 
> authenticated using handler: " + handlerName);
> //        }
> and closed the block line 268, just before
>          return handler;
> 
> In fact I just return the found user handler if any.
> 
> This works with my app as with the authentication-fw block sample, but 
> can someone check if any side effect can append ?

I'm not sure if there are side effects, I think no. But I would not
patch the original code. Unfortunately the behaviour of the component is
defined the way it is implemented: it should throw an exception :( This
isn't optimal but it's the way it is.

But you can "protected" your auth-login action with an auth-loggedIn
action in the sitemap. So you first check if the user is already logged
in and only if not you invoke the auth-login action.

Carsten


-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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


Mime
View raw message