Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Authenticator.getPasswordAuthentication: NTLM Caching

843811Aug 28 2007 — edited Feb 6 2009
Hello,

I have written a subclass of java.net.Authenticator and implemented the getPasswordAuthentication method for use with NTLM authentication. Then I call Authenticator.setDefault(myAuth);

At the first web service call to an IIS server the getPasswordAuthentication method is invoked and the NTLM authentication works like a charm.

When the user logs out of my Swing Application, the application doesn't shut down, but all the socket connections are closed, I call Authenticator.setDefault(null), various cleanup, and the user is presented with another Login Screen.

When the user logs in again with a different username and password, I again set the default authenticator, but HERE'S THE PROBLEM: the getPasswordAuthentication method is not invoked again! It seems to be cached in the JVM.

I know a lot of things are going on behind-the-scenes between IIS and Java; is there any way (besides shutting down the app and making the user launch it again) to trigger the invocation of getPasswordAuthentication so the server will recognize the newly-entered username/password?

Thanks,

Andrew

Message was edited by:
luxner
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2009
Added on Aug 28 2007
7 comments
638 views