I've set jndiSaltedJdbcRealm.authenticationCachingEnabled = true
doesn't work

I've even set:
public JNDIAndSaltAwareJdbcRealm() {
                setAuthenticationCachingEnabled(true);
        }
In my realm's constructor, but authenticationCachingEnabled is still false
when evaluating in 
AuthenticatingRealm.getAvailableAuthenticationCache();



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

but, AuthenticatingRealm.isAuthenticationCachingEnabled(token, info) always
returns false in
in
private void
AuthenticatingRealm.cacheAuthenticationInfoIfPossible(AuthenticationToken
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:
            return;
        }

        Cache<Object, AuthenticationInfo> cache =
getAvailableAuthenticationCache();
        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: 
http://shiro-user.582556.n2.nabble.com/how-to-log-out-another-user-programatically-authentication-cache-problem-tp7420486p7429528.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to