Hmm.. I'm still a bit confused. Let me try to explain myself better and please correct any wrong assumptions I've made.
As the javax.security.auth.login.Configuration javadocs state, at any given time, there is one Configuration object installed. I assume that this Configuration object is constructed by taking the configuration file (by accessing the java.security.auth.login.config java property) and parsing it.
If this is correct, then I should also be able to create a Configuration object named myConf, and then call Configuration.setConfiguration(myConf).
So, how do I create a Configuration?
First of all, Configuration is an abstract class, so rather than coding up my own implementation, I would prefer to use the existing one--the one LoginContext reads. Do you know which class this is?
However, creating an entirely new Configuration might have undesired effects. Thus, I would prefer to modify the existing Configuration. Supposedly, I can access the existing configuration by calling Configuration.getConfiguration(), but I keep getting a NullPointerException when I try to do that... I've also been unable to create a new Configuration by calling the Configuration.getInstance() method.