File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JNLP and Web Start and the fly likes Unwanted login dialog when running application from a JNLP. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Unwanted login dialog when running application from a JNLP." Watch "Unwanted login dialog when running application from a JNLP." New topic
Author

Unwanted login dialog when running application from a JNLP.

Jeff Boulianne
Greenhorn

Joined: Jul 12, 2011
Posts: 2

HI,

I'm building an application using the OpenCmis library to communicate with Cmis repositories. The librairy itself call REST services using the HttpUrlConnection object. So I don't have any access to the connection object. The authentication is made directly by the transport protocol: So the server returns a "http error 401 Unauthorize" when the provided credentials are wrong, the library catch the exception, raised a CmisSomethingException, the application manages it and everything works fine.

Everything works fine, until I tried to test the application outside my dev environment. The application is started from a JNLP and when I use it from there... some internal Java handling seems to outrun the library handling, catch the 401 error and pop a Java login dialog asking for credentials.

It works well if the user provides valid username and password. The login dialog is re-showned if the credentials are wrong. And finally, the 401 error is finally catched by the librairy (and passed to the application) if the login dialog is cancelled by the user.

The Look, the functionnalites and the feedback provided by this dialog to the user are not what we want.

Does anybody knows how to "bypass/get rid of" this dialog when using the app from Java web start???

Thanks

Jeff
Jeff Boulianne
Greenhorn

Joined: Jul 12, 2011
Posts: 2

I add the following statement just before calling the librairy and the login dialog just disappear.

Authenticator.setDefault(new Authenticator());

Jeff
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Unwanted login dialog when running application from a JNLP.
 
Similar Threads
Is editing of client copy of jnlp file possible when using JWS?
Exception handling issue
Servlets BASIC security question
help coroutine
Saving a resource on a client--best practices question