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("<userid>", 
"<password>".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"

Really appreciate your help here. Thanks!
_______________________

Regards,
Ravi Choppalli

Office : 1-513-723-4989
Mobile : 1-513-675-3737



  ________________________________
NOTICE: The information contained in this electronic mail transmission is 
intended by Convergys Corporation for the use of the named individual or entity 
to which it is directed and may contain information that is privileged or 
otherwise confidential. If you have received this electronic mail transmission 
in error, please delete it from your system without copying or forwarding it, 
and notify the sender of the error by reply email or by telephone (collect), so 
that the sender's address records can be corrected.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2709395

Reply via email to