diff --git a/core/src/main/java/org/acegisecurity/ui/digestauth/DigestProcessingFilter.java b/core/src/main/java/org/acegisecurity/ui/digestauth/DigestProcessingFilter.java
index 9529b5c5d4..6ab94934be 100644
--- a/core/src/main/java/org/acegisecurity/ui/digestauth/DigestProcessingFilter.java
+++ b/core/src/main/java/org/acegisecurity/ui/digestauth/DigestProcessingFilter.java
@@ -435,6 +435,14 @@ public class DigestProcessingFilter implements Filter, InitializingBean {
return digestMd5;
}
+ public void setUserCache(UserCache userCache) {
+ this.userCache = userCache;
+ }
+
+ public UserCache getUserCache() {
+ return userCache;
+ }
+
public void init(FilterConfig arg0) throws ServletException {}
private void fail(ServletRequest request, ServletResponse response,
diff --git a/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java b/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java
index 146abe1a36..5bfaf2ceb2 100644
--- a/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java
+++ b/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java
@@ -27,6 +27,7 @@ import net.sf.acegisecurity.context.ContextHolder;
import net.sf.acegisecurity.context.security.SecureContextImpl;
import net.sf.acegisecurity.context.security.SecureContextUtils;
import net.sf.acegisecurity.providers.dao.AuthenticationDao;
+import net.sf.acegisecurity.providers.dao.UserCache;
import net.sf.acegisecurity.providers.dao.UsernameNotFoundException;
import net.sf.acegisecurity.util.StringSplitUtils;
@@ -193,6 +194,11 @@ public class DigestProcessingFilterTests extends TestCase {
filter.setAuthenticationEntryPoint(new DigestProcessingFilterEntryPoint());
assertTrue(filter.getAuthenticationEntryPoint() != null);
+
+ filter.setUserCache(null);
+ assertNull(filter.getUserCache());
+ filter.setUserCache(new MockUserCache());
+ assertNotNull(filter.getUserCache());
}
public void testInvalidDigestAuthorizationTokenGeneratesError()
@@ -885,4 +891,14 @@ public class DigestProcessingFilterTests extends TestCase {
}
}
}
+
+ private class MockUserCache implements UserCache {
+ public UserDetails getUserFromCache(String username) {
+ return null;
+ }
+
+ public void putUserInCache(UserDetails user) {}
+
+ public void removeUserFromCache(String username) {}
+ }
}
diff --git a/doc/xdocs/changes.xml b/doc/xdocs/changes.xml
index 2fdf5eaf8e..2a204b4429 100644
--- a/doc/xdocs/changes.xml
+++ b/doc/xdocs/changes.xml
@@ -37,6 +37,7 @@
TokenBasedRememberMeServices now respects expired users, expired credentials and disabled users
HttpSessionContextIntegrationFilter now handles HttpSession invalidation without redirection
StringSplitUtils.split() ignored delimiter argument
+ DigestProcessingFilter now provides userCache getter and setter
Added Digest Authentication support (RFC 2617 and RFC 2069)