|
@@ -187,6 +187,7 @@ public class AuthenticationFilter implements Filter {
|
|
|
private long validity;
|
|
|
private String cookieDomain;
|
|
|
private String cookiePath;
|
|
|
+ private boolean isInitializedByTomcat;
|
|
|
|
|
|
/**
|
|
|
* <p>Initializes the authentication filter and signer secret provider.</p>
|
|
@@ -252,6 +253,7 @@ public class AuthenticationFilter implements Filter {
|
|
|
secretProvider = constructSecretProvider(
|
|
|
filterConfig.getServletContext(),
|
|
|
config, false);
|
|
|
+ isInitializedByTomcat = true;
|
|
|
} catch (Exception ex) {
|
|
|
throw new ServletException(ex);
|
|
|
}
|
|
@@ -380,6 +382,10 @@ public class AuthenticationFilter implements Filter {
|
|
|
authHandler.destroy();
|
|
|
authHandler = null;
|
|
|
}
|
|
|
+ if (secretProvider != null && isInitializedByTomcat) {
|
|
|
+ secretProvider.destroy();
|
|
|
+ secretProvider = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|