In my EJB 3, I am trying to test the roles of a principal, but it always returns false.
In my WebLogic 11g console, I defined in the section "MyDomain" → "Security Realms" → "myrealm" → "Users and groups" 3 users (user1, user2 and user3) and 2 groups (role1 and role2); role1 has user1 and user3, role2 has user2 and user3.
My EJB has no additional security (no @RolesAllowed, etc. Or records in DD).
When I test my EJB for roles with sessionContext.isCallerInRole(role);, it always returns false. If I call sessionContext.getCallerPrincipal().getName();, I get the correct user ID.
What am I doing wrong?
source
share