HttpClient commons-httpclient Digest Authentication
I am getting this error from PostMethod using commons-httpclient
No credentials available for domain DIGEST @localhost
and 401 back from the server.
I have followed the example from this post java client program to send digest authentication request using HttpClient API (2)
However, it still doesn't work.
I am trying to connect to XML-RPC service, we are using digest authentication. I tried using the Apache xmlrpc library but doesn't seem to support digest authentication.
Any ideas?
Thanks.
+2
a source to share
1 answer
I am trying to do the same. I now have an XML-RPC client:
public static short connectToBugTrackingXmlRpcServer() {
try {
XmlRpcClientConfigImpl xmlRpcClientConfig = new XmlRpcClientConfigImpl();
xmlRpcClientConfig.setServerURL(new URL(CStudioGlobals.bugTrackingConfProperties.getUrlXmlRpcServer()));
xmlRpcClientConfig.setBasicUserName(CStudioGlobals.bugTrackingConfProperties.getUsername());
xmlRpcClientConfig.setBasicPassword(CStudioGlobals.bugTrackingConfProperties.getPassword());
xmlRpcClientConfig.setEncoding("UTF-8");
XmlRpcClient xmlRpcClient = new XmlRpcClient();
xmlRpcClient.setConfig(xmlRpcClientConfig);
CTrackerDynamicProxy xmlRpcProxy = new CTrackerDynamicProxy(xmlRpcClient);
Ticket ticket = (Ticket)xmlRpcProxy.newInstance(Ticket.class);
ticket.query(); // query some tickets
return CONNECTION_SUCCESS;
} catch (Throwable t) {
t.printStackTrace();
displayError(CStudioGlobals.localization.getTerm("error.title.Sql_error"),
CStudioGlobals.localization.getTerm("error.content._Invalid_connection"),
CStudioGlobals.localization.getTerm("error.resolution.Check_your_connection_settings"));
return CONNECTION_RETRY;
}
}
but I would like to use email authentication. Could you explain, did you do it? Thanks,
+1
a source to share