Hello,
I want to clear the cached data for a certain user. All I have in my
hand is the username, which is not the name of the user which is logged
in. No Principle objects, Realms and so on. What I tried is this:
for (Realm realm : realms) {
if (!(realm instanceof AuthorizingRealm)) {
continue;
}
final org.apache.shiro.cache.Cache<Object,
AuthorizationInfo> zcache = ((AuthorizingRealm)
realm).getAuthorizationCache();
LOG.debug("cached credentials found for {}", realm.getName());
for (final Object key : zcache.keys()) { // zcache.keys()
is always empty
final PrincipalCollection principals =
(PrincipalCollection) key;
// what to do now?
// I want to delete everything for String username
}
}
But I even don't get to the "what to do now" line, because zcache.keys()
is always empty.
I'm using shiro 1.2.3 and ehcache with standard config.
Best,
Karsten