The JBossSecurityContextUtil's getUserPrincipal() method returns SimplePrincipal on remote EJB calls from a standalone client

Solution Unverified - Updated -

Issue

  • There is a security-domain which uses test.CustomPrincipal which extends org.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 CustomPrincipal as expected, but from a standalone client, it returns SimplePrincipal.

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.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.