Jersey Client API - authentication -
i'm using jersey client api submit soap requests jax-ws webservice. default jersey somehow using windows nt credentials authentication when challenged. can explain jersey in code? , can overriden?
i have tried using httpbasicauthfilter , adding filter on client. have tried adding credentials webresoruce queryparams field neither being picked up.
at first got working documented in jersey user guide
authenticator.setdefault (authinstance);
however did not relied on setting global authenticator. after research discovered jersey has httpbasicauthfilter
easier use.
client c = client.create(); c.addfilter(new httpbasicauthfilter(user, password));
see: https://jersey.github.io/nonav/apidocs/1.10/jersey/com/sun/jersey/api/client/filter/httpbasicauthfilter.html https://jersey.github.io/nonav/apidocs/1.10/jersey/com/sun/jersey/api/client/filter/filterable.html#addfilter(com.sun.jersey.api.client.filter.clientfilter)
Comments
Post a Comment