In my EJB 3 I try to test for the roles of the principal but it always returns false
.
In my WebLogic 11g Console I defined under "MyDomain" -> "Security Realms" -> "myrealm" -> "Users and Groups" 3 users (user1 , user2 & user3) and 2 groups (role1 & role2); role1 has user1 & user3, role2 has user2 & user3.
My EJB has no further security defined (no @RolesAllowed
, etc. or entries in DDs).
When I test in my EJB for the presence of roles with sessionContext.isCallerInRole(role);
it always returns false
. If I call sessionContext.getCallerPrincipal().getName();
I do get the correct user ID.
What am I doing wrong?
WebLogic Server Version: 10.3.4.0
– Koohoolinn