I want to access the full model of users with their roles in my SOAP app. For example, I might want to know the role of a user called "Fred."
How do I reach into some sort of global JAAS registry and do (pseudocode) globalRegistry.getUser("Fred").getPrincipals()? (Note that in JAAS, a role is represented by a Principal.)
I know how to get the Principal of the Subject from the LoginContext, but that has two problems.
I am using Jetty, but I presume that these behaviors are standard to JAAS.
We use a ThreadLocal variable to reference the current user as has been authenticated at the system entrypoint (a servlet or ejb in our case). This allows 'global' access to the current user. This is not directly tied to JAAS or any other security protocol, but can be initialized from them.
EDIT: The return from the ThreadLocal is the Subject for the current user.
Accessing other users would typically be done via some type of admin module.