使用Perl和WebDav访问共享点 [英] Accessing a sharepoint using perl and webdav

查看:270
本文介绍了使用Perl和WebDav访问共享点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题494120中提出了类似的问题,但恕我直言并没有真正回答...

a similar question was asked in question 494120, but IMHO was not really answered...

我想使用perl/WebDAV(从Win32主机)将文件上传到共享点.为此,我需要在服务器上使用KERBEROS进行身份验证.搜寻了几个小时并尝试了不同的方法后,我无法打开连接.当前代码是这样的:

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:

my $agent = HTTP::DAV::UserAgent->new(keep_alive=>1);  
$agent->agent('Agent');  
$agent->timeout(1000);  
my $d = HTTP::DAV->new(-useragent => $agent);  
$d->credentials( -user=>$user,-pass =>$pass, -url =>$url);  
$d->open( -url=>$url ) or die("Couldn't open $url: " .$d->message . "\n");  

在执行$ d-> open(...)时,我总是得到无法打开$ url:未经授权.要进行协商".因此,显然基本身份验证不起作用.

When doing the $d->open(...), I always get "Couldn't open $url: Unauthorized. Negotiate". So, obviously the basic authentication doesn't work.

请问有人能指出我正确的道路吗?我不固定使用WebDAV,任何其他机制也适合我.只是想让它工作...

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...

编辑1
Authen::NTLM一起使用LWP时(由建议Madhur )也不起作用.它在IIS和Apache上导致500 internal server error.由于在两个不同的Web服务器(具有两个不同的NTLM实现)上发生相同的错误,我想Authen::NTLM模块中肯定会有问题.

Edit 1
When using LWP along with Authen::NTLM (as suggested by Madhur) also doesn't work. It results in a 500 internal server error 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 Authen::NTLM module.

查看Authen::NTLM的实现在我看来,该代码是一种反向工程,既不是基于规范实现的,也不是真正可配置的.是什么引起了为什么没有使用规范来实现模块的问题...

Looking at the implementation of Authen::NTLM 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 the specification wasn't used to implement the module...

NTLM和Perl一起使用是一种奇特的用例吗?

Is using NTLM along with Perl such an exotic use case?

编辑2
根据Madhur的建议,我尝试使用Curl访问Sharepoint.这行得通.但是嗅探Curl的NTLM消息和Perl发送的NTLM消息告诉我,消息格式有所不同.

Edit 2
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.

推荐答案

代替使用WebDAV.我建议您使用开箱即用的Web服务.

Instead of using WebDAV. I would suggest you use out of the box web services.

这概述了如何在PERL中使用共享点Web服务:

This gives overview on how to use sharepoint web services in PERL:

http://www.squish.net/log/2008 /10/11/perl-sharepoint/

http://shareperl.blogspot.com/

这是使用Web服务上传文件的.NET代码: http://www.oriolardevol.com/Article/Details/3

And this is the .NET code to upload the file using web service: http://www.oriolardevol.com/Article/Details/3

将其转换为PERL代码是自我使用PERL以来已有多年的经验了:)

Converting it to PERL code is left to you as its been years since I used PERL :)

这篇关于使用Perl和WebDav访问共享点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆