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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content