inconsistent behavior of HttpServletRequest.getUserPrincipal() between EAP6 and EAP7

Solution In Progress - Updated -

Issue

The behavior of HttpServletRequest.getUserPrincipal() in EAP7 is different from EAP6. You can see it deploying the attached test.war in both of EAP6 and EAP7 as follows:

$ $JBOSS_HOME/bin/jboss-cli.sh -c --file=add_security-domain.cli
$ cp test.war $JBOSS_HOME/standalone/deployments/

Then restart EAP6/7, and you will see the behavior:

  1. Access http://localhost:8080/test/ . You will see HttpServletRequest.getUserPrincipal() is null in both EAP
  2. Access http://localhost:8080/test/secure/, and login as test/test. Then, you will see HttpServletRequest.getUserPrincipal() is "test" in both EAP
  3. Access http://localhost:8080/test/ again. You will see HttpServletRequest.getUserPrincipal() is "test" in EAP6, but HttpServletRequest.getUserPrincipal() is null in EAP7.

Environment

  • EAP6 and EAP7

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.