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 :)