The JBossSecurityContextUtil's getUserPrincipal() method returns SimplePrincipal on remote EJB calls from a standalone client
Issue
-
There is a security-domain which uses
test.CustomPrincipalwhich extendsorg.jboss.security.SimplePrincipal.- This is as follows:
<security-domain name="test" cache-type="default"> <authentication> <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"> <module-option name="principalClass" value="test.CustomPrincipal"/> </login-module> </authentication> </security-domain>- And, there is an EJB secured under the security-domain. It has the following method:
public Principal getPrincipal() { SecurityContext securityContext = SecurityContextAssociation.getSecurityContext(); if (securityContext == null) { return null; } else { return new JBossSecurityContextUtil(securityContext).getUserPrincipal() } }- When calling from a servlet, it returns
CustomPrincipalas expected, but from a standalone client, it returnsSimplePrincipal.
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.0.0
- 6.0.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
