Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing a sharepoint using perl and webdav
    text
    copied!<p>a similar question was asked in <a href="https://stackoverflow.com/questions/494120/how-can-i-upload-a-document-to-sharepoint-with-perl">question 494120</a>, but IMHO was not really answered...</p> <p>I want to upload files to a sharepoint using perl/WebDAV (from a Win32 host). To achive this, I need to authenticate with KERBEROS on the server. After googling for hours and trying different approaches, I'm not able to open a connection. Current code is this:</p> <pre><code>my $agent = HTTP::DAV::UserAgent-&gt;new(keep_alive=&gt;1); $agent-&gt;agent('Agent'); $agent-&gt;timeout(1000); my $d = HTTP::DAV-&gt;new(-useragent =&gt; $agent); $d-&gt;credentials( -user=&gt;$user,-pass =&gt;$pass, -url =&gt;$url); $d-&gt;open( -url=&gt;$url ) or die("Couldn't open $url: " .$d-&gt;message . "\n"); </code></pre> <p>When doing the $d->open(...), I always get "Couldn't open $url: Unauthorized. Negotiate". So, obviously the basic authentication doesn't work. </p> <p>Could anyone point me to the right path, please? I am not fixed to using WebDAV, any other mechanism would fit me as well. Just want to get it working...</p> <hr> <p><strong>Edit 1</strong><br> When using <code>LWP</code> along with <code>Authen::NTLM</code> (as suggested by <a href="https://stackoverflow.com/questions/4277340/accessing-a-sharepoint-using-perl-and-webdav/4649366#4649366">Madhur</a>) also doesn't work. It results in a <code>500 internal server error</code> on IIS as well as on Apache. Since the same error occurs on two different web servers (with two different NTLM implementations) I guess that there's gotta be a problem in the <code>Authen::NTLM</code> module. </p> <p><a href="http://cpansearch.perl.org/src/MARKBUSH/NTLM-1.02/NTLM.pm" rel="nofollow noreferrer">Looking at the implementation</a> of <code>Authen::NTLM</code> it seems to me that the code is kinda reverse engineered and neither implemented based on a specification nor is it really configurable. What turns up the question why <a href="http://msdn.microsoft.com/en-us/library/cc236621" rel="nofollow noreferrer">the specification</a> wasn't used to implement the module...</p> <p>Is using NTLM along with Perl such an exotic use case?</p> <hr> <p><strong>Edit 2</strong><br> Based on Madhur's suggestion, I tried accessing the Sharepoint with Curl. This works. But sniffing the NTLM messages of Curl and those sent by Perl shows me, that the message format is somehow different.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload