shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w0lfshad3 <>
Subject Re: how to log out another user programatically; authentication cache problem
Date Mon, 02 Apr 2012 14:37:46 GMT
I've set jndiSaltedJdbcRealm.authenticationCachingEnabled = true
doesn't work

I've even set:
public JNDIAndSaltAwareJdbcRealm() {
In my realm's constructor, but authenticationCachingEnabled is still false
when evaluating in 

I've enabled the cache doing this in my application instance initialization
	for (Realm r : ((RealmSecurityManager) SecurityUtils
			if (JNDIAndSaltAwareJdbcRealm.class.isInstance(r)) {
				Cache cache = ((JNDIAndSaltAwareJdbcRealm) r).getCacheManager()
										+ ".authenticationCache");
				((JNDIAndSaltAwareJdbcRealm) r).setAuthenticationCache(cache);

but, AuthenticatingRealm.isAuthenticationCachingEnabled(token, info) always
returns false in
private void
token, AuthenticationInfo info) {
        if (!isAuthenticationCachingEnabled(token, info)) {
            log.debug("AuthenticationInfo caching is disabled for info [{}]. 
Submitted token: [{}].", info, token);
            //return quietly, caching is disabled for this token/info pair:

        Cache<Object, AuthenticationInfo> cache =
        if (cache != null) {
            Object key = getAuthenticationCacheKey(token);
            cache.put(key, info);
            log.trace("Cached AuthenticationInfo for continued
authentication.  key=[{}], value=[{}].", key, info);

which means nothing gets cached anyway, looks like a bug?

View this message in context:
Sent from the Shiro User mailing list archive at

View raw message