1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[JBoss] How do I configure Jboss 8 to return custom principal

Discussão em 'StackOverflow' iniciado por Stack, Abril 28, 2025.

  1. Stack

    Stack Membro Participativo

    Issue Summary: We are encountering a blocker issue during our JBoss upgrade. Despite trying several solutions suggested by Copilot and Google, we are facing a new challenge: a white page error when logging in. It appears that Elytron is returning NamePrincipal instead of our custom principal (I_MyCustomSharedPrincipal) in the JSP using request.getUserPrincipal(). I_ MyCustomSharedPrincipal is an interface.

    Tech Stack: JBoss 8.0.6, Elytron 18, Java 21, PFA(standalone.xml and LdapMyCustomLoginModuleRealm class which implements I_MyCustomSharedPrincipal)

    Configurations Tried:


    1. Security Configuration: Wired security-domain, security-realm, http-authentication, and application-security-domain with custom-realm. Updated web.xml and jboss-web.xml to map to the correct security-domain and custom-realm.


    2. Custom Realm Implementation: Built the following APIs in the LdapMyCustomLoginModuleRealm class, which extends org.wildfly.security.auth.server.SecurityRealm: initialize method– invoked getRealmIdentity method– invoked verifyEvidence method– invoked exists method– invoked getAuthorizationIdentity method– invoked getAttributes method– invoked getRealmIdentityPrincipal method– not invoked


    3. Standalone Configuration: Mapped custom-realm in standalone.xml to LdapMyCustomLoginModuleRealm , which is invoked during login. Observed that the getRealmIdentityPrincipal methodAPI, which returns the Principal, is not being invoked. Since getRealmIdentityPrincipal methodnot getting invoked, I am not able return the custom principal(I_MyCustomSharedPrincipal) object in the JSP “request.getUserPrincipal()”.

    Continue reading...

Compartilhe esta Página