Hi,
I tried all the ways explained below... Here is a mail I sent to another
post... please bear with me if this is getting repeated as I'm using this
system for the first time..
=====================
Hi,
Really appreciate any help/direction. Thank you!
I'm trying to use the NTLM authentication to make a call to the Odata
webservice. It works fine on local because my local windows credentials are
probably used, and my userid is authenticated with the Dynamics CRM server
as I've an accoun there.
However I'm trying to run the same example by impersonation (passing
userid/password using java.net.Authenticator) as given in the example. This
is not working. Pls see at the end where I pasted output working directly
on windows….
This is the code I've
static class MyAuthenticator extends Authenticator {
public PasswordAuthentication getPasswordAuthentication() {
System.out.println("trying to authenticate");
return (new PasswordAuthentication("", "".toCharArray()));
}
}
And the following in main method..
// Sets the default Authenticator
Authenticator.setDefault(new MyAuthenticator());
apache% java -cp
.:org.restlet.jar:org.restlet.ext.xml.jar:org.restlet.ext.odata.jar:org.restlet.ext.freemarker.jar:org.restlet.ext.atom.jar:org.freemarker.ja>
Mar 3, 2011 11:12:03 AM org.restlet.ext.net.HttpClientHelper start
INFO: Starting the HTTP client
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
Mar 3, 2011 11:12:06 AM org.restlet.engine.security.AuthenticatorUtils
parseRequest
WARNING: Couldn't find any helper support the HTTP_Negotiate challenge
scheme.
Mar 3, 2011 11:12:06 AM org.restlet.engine.security.AuthenticatorUtils
parseRequest
WARNING: Couldn't find any helper support the HTTP_NTLM challenge scheme.
****** service.getClientVersion() = null
Mar 3, 2011 11:12:06 AM org.restlet.ext.odata.Service getMetadata
INFO: Get the metadata for
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/ at
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/$metadata
Mar 3, 2011 11:12:06 AM org.restlet.ext.net.HttpClientHelper start
INFO: Starting the HTTP client
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
trying to authenticate
Mar 3, 2011 11:12:07 AM org.restlet.ext.net.HttpClientHelper stop
INFO: Stopping the HTTP client
trying to authenticate
trying to authenticate
trying to authenticate
Mar 3, 2011 11:12:07 AM org.restlet.engine.security.AuthenticatorUtils
parseRequest
WARNING: Couldn't find any helper support the HTTP_Negotiate challenge
scheme.
Mar 3, 2011 11:12:07 AM org.restlet.engine.security.AuthenticatorUtils
parseRequest
WARNING: Couldn't find any helper support the HTTP_NTLM challenge scheme.
Mar 3, 2011 11:12:07 AM org.restlet.ext.odata.Service getMetadata
SEVERE: Can't get the metadata for
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/
(response's status: Unauthorized (401) - Unauthorized)
Mar 3, 2011 11:12:07 AM org.restlet.ext.odata.Service getMetadata
INFO: Get the metadata for
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/ at
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/$metadata
Works fine on my local windows - Here is the output
Mar 3, 2011 10:35:17 AM org.restlet.ext.net.HttpClientHelper start
INFO: Starting the HTTP client
****** service.getClientVersion() = null
Mar 3, 2011 10:35:27 AM org.restlet.ext.odata.Service getMetadata
INFO: Get the metadata for
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/ at
http://orldwv707/e2erbmsprint2/xrmServices/2011/organizationdata.svc/$metadata
Mar 3, 2011 10:35:27 AM org.restlet.ext.net.HttpClientHelper start
INFO: Starting the HTTP client
Mar 3, 2011 10:35:29 AM org.restlet.ext.net.HttpClientHelper stop
INFO: Stopping the HTTP client
Mar 3, 2011 10:35:32 AM org.restlet.ext.net.HttpClientHelper start
INFO: Starting the HTTP client
Cvg_invoicingcompanyId: e67fe097-daea-df11-9460-00155dfa1b3d
Cvg_invoicingcompanyName: VAT/GST ICO
Cvg_invoicingcompanyId: e77fe097-daea-df11-9460-00155dfa1b3d
Cvg_invoicingcompanyName: UST ICO
===========================================
I also tried using Apache HttpClient with JCFS library and used the
MyNtlmHttpClientHelper.java and even then I keep getting the same error
"Couldn't find any helper support the HTTP_Negotiate challenge scheme"
fyi.. This did not work even on windows machine....
Really appreciate your help here. Thanks!
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/OData-Service-and-NTLM-tp5024333p6086355.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2709396