Friday, August 30, 2013

Getting rid of extra authentication window poping up in a JNLP

Today I'm going to describe you about a problem that we faced few days before and it almost took two days to come up with a solution. We have a server which is authenticated with basic authentication. There is a java client which talks to this server through a JNLP. JNLP (Java Network Launching Protocol) is a file defined with XML schema which specifies how to launch Java Web Start application. When it tries to connect to the server for the first time, it pops up an extra authentication window as below. 



This problem has faced by many people and you will see there are lots of questions posted regarding this. Most of them were not answered, as well as most of the solutions posted are not that helpful either. 

Solution is simple. You just need to add a simple property to your JNLP file. Then this annoying authentication window will go away. The magic property is this. 


As a developer when I saw this property, I thought that the value should be set as "false" in order to prevent that window. And I tested with that value, but no success. Then I came across this bug that has been reported. So the value should be set as "true".  

Hope this post will helpful to someone and hope you will not end up wasting your time like me :)  






2 comments:

Al Pivonka said...

I too am facing the same issue.
Yet when I implement your referenced solution javaws seems to ignore it.

Looking at the source code within:
http://code.google.com/p/jdk-source-code/source/browse/trunk/jdk6u21_src/deploy/src/common/share/classes/com/sun/deploy/config/Config.java?r=24

Line number (1960) I agree with your assesment on the true/false values..

Yet the way it is stated, as long as it is any value other then "true" or "all" it will equate to false.


I am still looking for a fix for this.

Thank you

Al Pivonka said...

I have found a solution that is working, yet will require and update to the end users deployment.properties file with the addition of:
deployment.security.authenticator=false

Hope this helps someone