Hi Alex,

I'm not sure what you mean by 'logged in on other realms'.  By design,
a Realm is not usually stateful: it does not know who is logged in or
not.  (Note however that a caching layer is provided to realms to
improve their performance, but this is optional and does not reflect
'login state').  Who is logged in or not is determined based on
Session association.

If your Realm implementation subclasses CachingRealm (as most do), the
onLogout method is called when a Subject explicitly logs out (i.e.
subject.logout()).  By default, this merely clears any cached data for
that particular subject in that realm only.

You can override this method for custom behavior if desired.

Also note that the CachingRealm.onLogout method will not be called if
a Session times out (since that is not technically a logout, it is
disassociation by inactivity).  The realm's onLogout method is called
only as a result of calling subject.logout().

HTH,

-- 
Les Hazlewood
CTO, Katasoft | http://www.katasoft.com | 888.391.5282
twitter: @lhazlewood | http://twitter.com/lhazlewood
katasoft blog: http://www.katasoft.com/blogs/lhazlewood
personal blog: http://leshazlewood.com

On Tue, Aug 30, 2011 at 8:42 AM, Alex Vasilenko <[email protected]> wrote:
> Hello,
> I'm going to use multiple realms to authenticate users. And modular logout
> from one realm, meanwhile being logged in other realms.
> Is it possible to logout in one realm only, without rewriting shiro?
> Thanks,
> Alex

Reply via email to