Availability of authenticated Subject via j_security attribute in JBoss EAP 4.3

Solution Verified - Updated -

Environment

  • JBoss Enterprise Application Platform (EAP) 4.3.0.GA_CP10

Issue

  • We have custom Filters where following code used to work in JBoss 4.0.5 but doesn't work in JBoss EAP 4.3. It returns null
Subject subject = (Subject) request.getAttribute("j_subject");

Resolution

This feature is disabled by default in JBoss EAP 4.3. To enable it, edit following file

jboss-eap-4.3/jboss-as/server/<profile>/deploy/jboss-web.deployer/META-INF/jboss-service.xml

and search and uncomment following lines

 <!--
      <attribute name="SubjectAttributeName">j_subject</attribute>
 -->

Re-start server for the changes to take effect.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

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