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").getPricipals()? (Note that in JAAS, roles are represented by Principals.)
I know how to get the Principal of the Subject from the LoginContext, but that has two problems.
- It is only at the moment of login, and I'd prefer not to code the aforementioned registry and store the Subject and Principal objects myself, as I they are already stored by the appserver.
- Preferably, I want to be able to access this information even when Fred is not the current user.
I am using Jetty, but I presume that these behaviors are standard to JAAS.