cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components DefaultAuthenticationManager.java Authenticator.java PipelineAuthenticator.java
Date Fri, 24 Oct 2003 08:41:46 GMT
cziegeler    2003/10/24 01:41:46

  Modified:    src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
                        DefaultAuthenticationManager.java
                        Authenticator.java PipelineAuthenticator.java
  Log:
  Adding notification for logout
  
  Revision  Changes    Path
  1.20      +10 -1     cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
  
  Index: DefaultAuthenticationManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultAuthenticationManager.java	24 Oct 2003 08:26:35 -0000	1.19
  +++ DefaultAuthenticationManager.java	24 Oct 2003 08:41:46 -0000	1.20
  @@ -396,6 +396,7 @@
           final String redirectURI = config.getRedirectURI();
           return SourceUtil.appendParameters(redirectURI, parameters);
       }
  +    
   	/* (non-Javadoc)
   	 * @see org.apache.cocoon.webapps.authentication.components.Manager#isAuthenticated(java.lang.String)
   	 */
  @@ -417,6 +418,14 @@
           UserHandler handler = this.getUserHandler( handlerName );
           // we don't throw an exception if we are already logged out!
           if ( handler != null ) {
  +            
  +            // notify the authenticator
  +            try {
  +                this.lookupAuthenticator(config).logout(handler);
  +            } catch (Exception ignore) {
  +                // we really ignore any exception!
  +            }
  +            
               List applicationContexts = handler.getApplicationContexts();
               if ( applicationContexts != null ) {
                   ContextManager contextManager = null;
  
  
  
  1.10      +12 -3     cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/Authenticator.java
  
  Index: Authenticator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/Authenticator.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Authenticator.java	24 Oct 2003 08:26:35 -0000	1.9
  +++ Authenticator.java	24 Oct 2003 08:41:46 -0000	1.10
  @@ -52,6 +52,7 @@
   
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration;
  +import org.apache.cocoon.webapps.authentication.user.UserHandler;
   import org.apache.excalibur.source.SourceParameters;
   import org.w3c.dom.Document;
   
  @@ -105,7 +106,15 @@
        *         successful) or invalid (authentication failed.
        * @throws ProcessingException Only if an error occurs
        */
  -    public AuthenticationResult authenticate(HandlerConfiguration configuration,
  -                                             SourceParameters parameters)
  +    AuthenticationResult authenticate(HandlerConfiguration configuration,
  +                                      SourceParameters parameters)
       throws ProcessingException;
  +    
  +    /**
  +     * This notifies the authenticator that a user logs out of the given
  +     * handler.
  +     * After the authenticator is notified, the AuthenticationManager
  +     * removes the authentication context, eventually the session etc.
  +     */
  +    void logout(UserHandler handler);
   }
  
  
  
  1.7       +9 -1      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java
  
  Index: PipelineAuthenticator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PipelineAuthenticator.java	24 Oct 2003 08:26:35 -0000	1.6
  +++ PipelineAuthenticator.java	24 Oct 2003 08:41:46 -0000	1.7
  @@ -63,6 +63,7 @@
   import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration;
  +import org.apache.cocoon.webapps.authentication.user.UserHandler;
   import org.apache.cocoon.webapps.session.MediaManager;
   import org.apache.cocoon.xml.XMLUtils;
   import org.apache.cocoon.xml.dom.DOMUtil;
  @@ -319,6 +320,13 @@
        */
       public void contextualize(Context context) throws ContextException {
           this.context = context;
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.webapps.authentication.components.Authenticator#logout(org.apache.cocoon.webapps.authentication.user.UserHandler)
  +     */
  +    public void logout(UserHandler handler) {
  +        // we simply do nothing here
       }
   
   }
  
  
  

Mime
View raw message