SEC-2302: Provide beforeSpringSecurityFilterChain hook

This allows inserting filters before the springSecurityFilterChain.
This commit is contained in:
Rob Winch 2013-09-25 14:52:40 -05:00
parent 88f41cdf62
commit b591881e95
1 changed files with 9 additions and 0 deletions

View File

@ -108,6 +108,7 @@ public abstract class AbstractSecurityWebApplicationInitializer implements WebAp
*/ */
public final void onStartup(ServletContext servletContext) public final void onStartup(ServletContext servletContext)
throws ServletException { throws ServletException {
beforeSpringSecurityFilterChain(servletContext);
if(configurationClasses != null) { if(configurationClasses != null) {
AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext(); AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext();
rootAppContext.register(configurationClasses); rootAppContext.register(configurationClasses);
@ -283,6 +284,14 @@ public abstract class AbstractSecurityWebApplicationInitializer implements WebAp
return null; return null;
} }
/**
* Invoked before the springSecurityFilterChain is added.
* @param servletContext the {@link ServletContext}
*/
protected void beforeSpringSecurityFilterChain(ServletContext servletContext) {
}
/** /**
* Invoked after the springSecurityFilterChain is added. * Invoked after the springSecurityFilterChain is added.
* @param servletContext the {@link ServletContext} * @param servletContext the {@link ServletContext}