Hi Les

Appreciate your time. I have configured the ecache like this in the
applicationContext..xml in our wicket application.

<bean id="cacheManager"
class="org.apache.shiro.cache.ehcache.EhCacheManager">
        <property name="cacheManager" ref="ehCacheManager"/>
</bean>

<bean id="ehCacheManager" class="net.sf.ehcache.CacheManager"/>

public class ArkLdapRealm extends AuthorizingRealm{

...
@Override
    public void clearCachedAuthorizationInfo(PrincipalCollection principals)
{
        super.clearCachedAuthorizationInfo(principals);
    }
}

Now when a user action is performed on the front end like selecting a
particular Tab which represents a usecase..this is what I do..
//I get a reference to the realm instance via Spring bean injection
realm.clearCachedAuthorizationInfo(currentUser.getPrincipals());

Next Authorization check: delegates the call to the Realm instance and as
you mentioned in one of your posts executes the doGetAuthorizationInfo()..

securityManager.isPermitted(currentUser.getPrincipals(), 
PermissionConstants.CREATE) (etc)

With this in place..I am able to load the set of permissions for the
selected usecase function so its very dynamic as its the feature of Shiro to
widen a user permission or restrict without him having to log out. All this
is nice.

Probably the ecache implementation is incorrectly configured? Without
clearning the cache..it was lot better so I am leaning on the fact that this
behaviour is causing the issue. 

Any thoughts. Thanks again Les for the time. 

Regarding posts not being accepted, I posted this via an email and not via
the forum and has gotten accepted. So i guess will follow suit in future.

Many Thanks
Niv






--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Invalidating-Authentication-Cache-slows-performance-tp6329816p6333063.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to