Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow custom authentication mechanism for the Java client #141
Currently the Java client allows only Basic Authentication. However, the karaf deployed hawt.io uses a different mechanism:
In order to allow such a custom authentication mechanism, hooks must be added perform this login step in advance.
See also the discussion at the Jolokia Forum
A base implementation has been already implemented (though not yet pushed). In the meantime one can prepare an HttpClient (i.e. performing the steps above) and the using the public constructor of
It turns out, that for hawt.io it is sufficient to simply use preemptive Basic-Authentication.
So the following should do the trick for now
J4pClient j4p = J4pClient.url("..").user("karaf").password("karaf").build(); DefaultHttpClient client = (DefaultHttpClient) j4p.getHttpClient(); client.addRequestInterceptor(new PreemptiveAuthInterceptor());