Web application fails to retrieve the Subject when using JAAS authentication in JWS Tomcat

Solution Verified - Updated -

Issue

  • After having authenticated the user properly by using JAAS (either through JAASRealm or a custom implementation), the web application fails to retrieve the Subject object properly. This API call always returns null:

    Subject.getSubject(AccessController.getContext())
    

Environment

  • Red Hat Enterprise Linux (RHEL)
    • 7
  • Red Hat JBoss Web Server (JWS)
  • Tomcat
  • Security Manager

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