From 8f1bc603d4d3641113f4de1bca8126a90a32c0c6 Mon Sep 17 00:00:00 2001 From: Dave Ward Date: Thu, 13 Aug 2009 14:02:22 +0000 Subject: [PATCH] Merged V3.2 to HEAD 15495: ETHREEOH-2149: Fix up setting of the content language filter in all authentication filters - Some new thread initialization was added to AuthenticationHelper concerning setting the locale for MLText properties - Unfortunately this was not propagated to the more exotic authentication filters - Now all web client authentication filters use shared code in AuthenticationHelper - Retired the NovellIChainsHTTPRequestAuthenticationFilter because it was broken and can be replaced by the superior HTTPRequestAuthenticationFilter git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15735 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../auth/BaseKerberosAuthenticationFilter.java | 2 +- .../auth/BaseNTLMAuthenticationFilter.java | 10 +++++----- .../auth/BaseSSOAuthenticationFilter.java | 17 +++++++++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java index b18e1de0d2..b798a908c5 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseKerberosAuthenticationFilter.java @@ -313,7 +313,7 @@ public abstract class BaseKerberosAuthenticationFilter extends BaseSSOAuthentica reqAuth = false; // Filter validate hook - onValidate( req, httpSess); + onValidate( context, req, resp); } catch (AuthenticationException ex) { diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java index 32c77a9651..6a73d53c34 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseNTLMAuthenticationFilter.java @@ -241,7 +241,7 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication reqAuth = false; // Filter validate hook - onValidate( req, httpSess); + onValidate( context, req, resp); } catch (AuthenticationException ex) { @@ -336,7 +336,7 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication { // Process the type 3 NTLM message Type3NTLMMessage type3Msg = new Type3NTLMMessage(ntlmByts); - processType3(type3Msg, req, resp, httpSess, chain); + processType3(type3Msg, context, req, resp, httpSess, chain); } else { @@ -473,7 +473,7 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication * @exception IOException * @exception ServletException */ - protected void processType3(Type3NTLMMessage type3Msg, HttpServletRequest req, HttpServletResponse res, + protected void processType3(Type3NTLMMessage type3Msg, ServletContext context, HttpServletRequest req, HttpServletResponse res, HttpSession session, FilterChain chain) throws IOException, ServletException { Log logger = getLogger(); @@ -521,7 +521,7 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication // Validate the user ticket authenticationService.validate(user.getTicket()); - onValidate(req, session); + onValidate(context, req, res); } catch (AuthenticationException ex) { @@ -660,7 +660,7 @@ public abstract class BaseNTLMAuthenticationFilter extends BaseSSOAuthentication } } - onValidate(req, session); + onValidate(context, req, res); // Update the NTLM logon details in the session String srvName = getServerName(); diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java index 149887eab2..662e25265d 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java @@ -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; @@ -28,6 +28,7 @@ import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; +import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -336,12 +337,16 @@ public abstract class BaseSSOAuthenticationFilter implements DependencyInjectedF } /** - * Callback executed on successful ticket validation during Type3 Message processing + * Callback executed on successful ticket validation during Type3 Message processing. * - * @param req HttpServletReqeust - * @param session HttpSession + * @param sc + * the servlet context + * @param req + * the request + * @param res + * the response */ - protected void onValidate(HttpServletRequest req, HttpSession session) + protected void onValidate(ServletContext sc, HttpServletRequest req, HttpServletResponse res) { }