inconsistent behavior of HttpServletRequest.getUserPrincipal() between EAP6 and EAP7
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:
- Access http://localhost:8080/test/ . You will see HttpServletRequest.getUserPrincipal() is null in both EAP
- Access http://localhost:8080/test/secure/, and login as test/test. Then, you will see HttpServletRequest.getUserPrincipal() is "test" in both EAP
- 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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
