Hello all.

I have a design issue I have come up against with regards to the
authentication realm used by our J2EE application deployed on WAS 6.0.

The task I am currently aiming at is to search for all the roles a
particular user id is eligible to in my EJB's. I can somehow manage
that by setting the environment variables reflecting the path to my
LDAP server and getting an InitialDirContext. But I have an additional
requirement that if tomorrow the client decides to change the realm
from LDAP to Database or some other mechanism of specifying security,
the code which performs the above task shouldn't be affected.

So what I need here would be some sort of Websphere specific API which
would get hold of the Context of the current realm in use irrespective
of the implementation which would then be used for querying user
roles. Can this be done?

I hope that made sense. Any kind of help would be much appreciated.

Thanks and regards,