From b591881e954ae742662c5becdf2f03fa7cf75f04 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Wed, 25 Sep 2013 14:52:40 -0500 Subject: [PATCH] SEC-2302: Provide beforeSpringSecurityFilterChain hook This allows inserting filters before the springSecurityFilterChain. --- .../AbstractSecurityWebApplicationInitializer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java b/web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java index ca08b8a786..2da38dd368 100644 --- a/web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java +++ b/web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java @@ -108,6 +108,7 @@ public abstract class AbstractSecurityWebApplicationInitializer implements WebAp */ public final void onStartup(ServletContext servletContext) throws ServletException { + beforeSpringSecurityFilterChain(servletContext); if(configurationClasses != null) { AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext(); rootAppContext.register(configurationClasses); @@ -283,6 +284,14 @@ public abstract class AbstractSecurityWebApplicationInitializer implements WebAp return null; } + /** + * Invoked before the springSecurityFilterChain is added. + * @param servletContext the {@link ServletContext} + */ + protected void beforeSpringSecurityFilterChain(ServletContext servletContext) { + + } + /** * Invoked after the springSecurityFilterChain is added. * @param servletContext the {@link ServletContext}