I am attempting to login to Microsoft Dynamic CRM from Linux. The CRM software is configured to use NTLM for authentication. I have installed Authen::NTLM and was still unable to authenticate to the CRM software but was able to authenticate to Sharepoint. I found this information about Negotiate (found at http://davenport.sourceforge.net/ntlm.html#ntlmHttpAuthentication) “With Windows 2000, Microsoft introduced the "Negotiate" HTTP authentication mechanism. While primarily aimed at providing a means of authenticating the user against Active Directory via Kerberos, it is backward-compatible with the NTLM scheme. When the Negotiate mechanism is used in "legacy" mode, the headers passed between the client and server are identical, except "Negotiate" (rather than "NTLM") is indicated as the mechanism name. “ and then installed LWP::Authen::Negotiate because the authentication had Negotiate before the authentication strings but have still been unable to successfully authenticate. Below is the script and result I receive (after I have authenticated to a domain). Does anyone have any advice on how to successfully authenticate to the CRM software?
Script: use LWP::Debug qw(+); use LWP::UserAgent; my $url = 'http:// xxxxx.xxx.xxx /'; # Set up the ntlm client and then the base64 encoded ntlm handshake me +ssage my $ua = new LWP::UserAgent(keep_alive=>1); $ua->credentials(xxxxx.xxx.xxx:80', '', 'xxx\xxxxxxxxxxxxx' => 'xxxxxx +xxxxxx'); #$request = GET $url; my $request = new HTTP::Request GET => $url; print "--Performing request now...-----------\n"; $response = $ua->request($request); print "--Done with request-------------------\n"; #my $content = $response->content; my $content = $response->as_string; print $content . "\n"; if ($response->is_success) {print "It worked!->" . $response->code . " + " . $response->message . "\n"} else {print "It didn't work!->" . $response->code . "\n"} Result with only Authen::NTLM installed: LWP::UserAgent::new: () --Performing request now...----------- LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http:// xxxxx.xxx.xxx LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 51 bytes LWP::Protocol::http::request: Keep the http connection to xxxxx.xxx.xx +x:80 LWP::UserAgent::request: Simple response: Unauthorized LWP::Authen::Ntlm::authenticate: authenticate() has been called Use of uninitialized value in exists at /usr/lib/perl5/site_perl/5.8.3 +/LWP/UserAgent.pm line 566. Use of uninitialized value in hash element at /usr/lib/perl5/site_perl +/5.8.3/LWP/UserAgent.pm line 567. LWP::Authen::Ntlm::authenticate: In first phase of NTLM authentication LWP::Authen::Ntlm::authenticate: Returning response object with auth h +eader: Authorization NTLM TlRMTVNTUAABAAAAB7IAABQAFAAgAAAABgAGADQAAABpY3MtZW5 +nLW1vbi1vcGluaW9ubHN0Z2xkcw== LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http:// xxxxx.xxx.xxx LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 100 bytes LWP::UserAgent::request: Simple response: Internal Server Error --Done with request------------------- HTTP/1.1 500 Internal Server Error Connection: close Date: Thu, 16 Jul 2009 17:13:30 GMT Server: Microsoft-IIS/6.0 Content-Length: 100 Content-Type: text/html Client-Date: Thu, 16 Jul 2009 17:12:31 GMT Client-Peer: 10.96.114.26:80 Client-Response-Num: 2 Title: Error X-Powered-By: ASP.NET <html><head><title>Error</title></head><body>The function requested is + not supported </body></html> It didn't work!->500 Result with LWP::Authen::Negotiate installed: LWP::UserAgent::new: () --Performing request now...----------- LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http://xxxxx.xxx.xxx/ LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 51 bytes LWP::Protocol::http::request: Keep the http connection to xxxxx.xxx.xx +x/:80 LWP::UserAgent::request: Simple response: Unauthorized LWP::Authen::Negotiate::authenticate: authenticate() version 0.06 call +ed LWP::Authen::Negotiate::authenticate: target hostname xxxxx.xxx.xxx LWP::Authen::Negotiate::authenticate: GSSAPI servicename HTTP@ xxxxx.x +xx.xxx LWP::Authen::Negotiate::authenticate: successfull $ctx->init() LWP::UserAgent::request: () LWP::UserAgent::send_request: GET http:// xxxxx.xxx.xxx / LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 51 bytes LWP::Protocol::http::request: Keep the http connection to xxxxx.xxx.xx +x:80 LWP::UserAgent::request: Simple response: Unauthorized LWP::Authen::Negotiate::authenticate: authenticate() version 0.06 call +ed LWP::Authen::Negotiate::authenticate: target hostname xxxxx.xxx.xxx LWP::Authen::Negotiate::authenticate: GSSAPI servicename HTTP@ xxxxx.x +xx.xxx LWP::Authen::Negotiate::authenticate: Invalid token was supplied LWP::Authen::Negotiate::authenticate: No error --Done with request------------------- HTTP/1.1 401 Unauthorized Date: Tue, 14 Jul 2009 15:35:29 GMT Server: Microsoft-IIS/6.0 WWW-Authenticate: Negotiate YIGWBgkqhkiG9xIBAgIDAH6BhjCBg6ADAgEFoQMCAR +6kERgPMjAwOTA3MTQxNTM1MjlapQUCAwnxTqYDAgE8qRMbEVNURy5MRFNDSFVSQ0guT1J +HqjAwLqADAgEDoScwJRsEaG9zdBsdY2hxcHZ1dzg0MDQuc3RnLmxkc2NodXJjaC5vcmes +EQQPMA2hAwIBAaIGBARqAADA Content-Length: 51 Content-Type: text/plain Client-Date: Tue, 14 Jul 2009 15:34:38 GMT Client-Peer: 10.96.114.26:80 Client-Response-Num: 2 X-Powered-By: ASP.NET HTTP Error 401.1 - Unauthorized: Access is denied

In reply to Authenticating to Microsoft Dynamic CRM by mart1076

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.