snoopy_co has asked for the wisdom of the Perl Monks concerning the following question:

I'm attempting to use Perl and the Win32::LWP code to access a web page using Microsoft Sharepoint/IIS, and am running into Authentication issues, specifically an "Unauthorized 401.2" error. After a couple of weeks of web and book searching for the right answer, here I am. More than anything I'm hoping to get a better understanding of the output I'm seeing. This seems to be a popular problem, I've seen other cases of people trying and failing with this, but no "so this is how this works!" solutions yet. I'm told by the Website Admin the site is using standard NT authentication. I've tried the different Auth schemes I've seen suggested, without success. For example:
$browser->credentials ( 'foo.com:80', '', 'DOMAIN\username' => 'passwd' (with our without DOMAIN) );
Which still gives the 401.2 error. As well as the style:
$req->authorization_basic('userid', 'passwd');
Key parts of the debugging output include:
LWP::UserAgent::_need_proxy: Not proxied
So looks like proxy problems aren't involved?
LWP::UserAgent::request: Simple response: Unauthorized GET http://foo.bar.com/default.aspx User-Agent: libwww-perl/5.806
I take this to mean it tried a simple get, which failed, so it tried to send an AUTH header. The User-Agent tells me that my version of Perl is current - is that correct? I've also tried setting the UserAgent to something like "User-Agent: User-Agent: Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC)" without change to the result. The debugging output continues with:
HTTP/1.1 401 Unauthorized Date: Thu, 03 Jan 2008 01:31:57 GMT Server: Microsoft-IIS/6.0 WWW-Authenticate: NTLM Content-Length: 1656 Content-Type: text/html Content-Type: text/html; charset=Windows-1252 Client-Date: Thu, 03 Jan 2008 01:31:58 GMT Client-Peer: (IP snipped):80 Client-Response-Num: 1 Client-Warning: Unsupported authentication scheme 'ntlm' MicrosoftSharePointTeamServices: 6.0.2.8103 Title: You are not authorized to view this page X-Powered-By: ASP.NET
The "Title:" error segment threw me at first, thinking I had the userid wrong, but doublechecked that and it was good. The "Client-Warning" line has me confused; I was under the impression that the "credentials" style syntax I used *was* "NTLM" style. A couple more revelent messages from the output:
You do not have permission to view this directory or page using the cr +edentials that you supplied because your Web browser is sending a WWW +-Authenticate header field that the Web server is not configured to a +ccept.
and:
HTTP Error 401.2 - Unauthorized: Access is denied due to server config +uration. Internet Information Services (IIS)
So that's that -- the server *seems* to be telling me its using NTLM auth, the client seems to be trying to auth against it, but isn't telling the server what it wants to see. Does anyone have more insight into exactly what the debug output is telling me, and what might make this work? Thank you for your time!