Merged V3.2 to HEAD

15727: ETHREEOH-2617: When SSO is disabled in a subsystem, disable initialization of its filters
      - Do not validate filter configuration parameters in NTLM and Kerberos authentication filters when the filter is disabled


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15729 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-08-13 11:48:12 +00:00
parent 71fb7f707b
commit eee41b31ec
5 changed files with 43 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2009 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -18,7 +18,7 @@
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
@@ -130,12 +130,12 @@ public abstract class BaseKerberosAuthenticationFilter extends BaseSSOAuthentica
/* (non-Javadoc)
* @see org.alfresco.repo.web.filter.beans.BaseSSOAuthenticationFilter#afterPropertiesSet()
* @see org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter#init()
*/
@Override
public void afterPropertiesSet() throws Exception
protected void init() throws ServletException
{
super.afterPropertiesSet();
super.init();
if ( m_krbRealm == null)
{

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -18,9 +18,9 @@
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.webdav.auth;
@@ -128,14 +128,15 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication
m_mapUnknownUserToGuest = mapUnknownUserToGuest;
}
/* (non-Javadoc)
* @see org.alfresco.repo.web.filter.beans.BaseSSOAuthenticationFilter#afterPropertiesSet()
* @see org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter#init()
*/
@Override
public void afterPropertiesSet() throws Exception
protected void init() throws ServletException
{
// Call the base SSO filter initialization
super.afterPropertiesSet();
super.init();
// Check that the authentication component supports the required mode

View File

@@ -170,7 +170,7 @@ public abstract class BaseSSOAuthenticationFilter implements DependencyInjectedF
* @param active
* <code>true</code> if the bean is active and initialization should complete
*/
public void setActive(boolean active)
public final void setActive(boolean active)
{
this.m_isActive = active;
}
@@ -179,15 +179,29 @@ public abstract class BaseSSOAuthenticationFilter implements DependencyInjectedF
* (non-Javadoc)
* @see org.alfresco.repo.management.subsystems.ActivateableBean#isActive()
*/
public boolean isActive()
public final boolean isActive()
{
return m_isActive;
}
/* (non-Javadoc)
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
public void afterPropertiesSet() throws Exception
public final void afterPropertiesSet() throws ServletException
{
// Don't trigger initialization if this component has been disabled
if (isActive())
{
init();
}
}
/**
* Initializes the filter. Only called if the filter is active, as indicated by {@link #isActive()}. Subclasses
* should override.
*/
protected void init() throws ServletException
{
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -18,7 +18,7 @@
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
@@ -26,6 +26,7 @@ package org.alfresco.repo.webdav.auth;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@@ -46,16 +47,17 @@ public class KerberosAuthenticationFilter extends BaseKerberosAuthenticationFilt
private static Log logger = LogFactory.getLog(KerberosAuthenticationFilter.class);
/* (non-Javadoc)
* @see org.alfresco.repo.webdav.auth.BaseKerberosAuthenticationFilter#afterPropertiesSet()
* @see org.alfresco.repo.webdav.auth.BaseKerberosAuthenticationFilter#init()
*/
@Override
public void afterPropertiesSet() throws Exception
protected void init() throws ServletException
{
// Call the base Kerberos filter initialization
super.afterPropertiesSet();
super.init();
// Enable ticket based logons

View File

@@ -18,7 +18,7 @@
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
@@ -26,6 +26,7 @@ package org.alfresco.repo.webdav.auth;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@@ -45,14 +46,15 @@ public class NTLMAuthenticationFilter extends BaseNTLMAuthenticationFilter
// Debug logging
private static Log logger = LogFactory.getLog(NTLMAuthenticationFilter.class);
/* (non-Javadoc)
* @see org.alfresco.repo.webdav.auth.BaseNTLMAuthenticationFilter#afterPropertiesSet()
* @see org.alfresco.repo.webdav.auth.BaseNTLMAuthenticationFilter#init()
*/
@Override
public void afterPropertiesSet() throws Exception
protected void init() throws ServletException
{
super.afterPropertiesSet();
super.init();
// Enable ticket based logons