I'm using the default login-config.xml for server policy configuration with JBoss 4.0.5. There's just a single application-policy defined, for Kerberos.
I'd like to read this policy from within a service method - this is primarily to detect a bad configuration (e.g. an SPN with a hostname/IP component that doesn't match the current host) and give better guidance to the server administrator through logging and a more specific exception that can cue the admin client to put up helpful instructions.
I could go out and parse the login-config.xml from the filesystem, but presumably there's a way to get a PolicyConfig object or similar representation of the configured policy and inspect its module-option settings in code; I'd prefer to do that.
Can anyone tell me how to get there from here?
Look at the static class in the JDK called as "Configuration" that gives you a hook into the JAAS configuration. That is what our processing of the login-config.xml finally leads into.