通过 PHP 和 SOAP 对 Sharepoint/Office356 进行身份验证(声明)


Authenticating (claims) to Sharepoint/Office356 through PHP and SOAP

我正在尝试使用需要身份验证的PHP5标准SOAP库向Sharepoint列表发出SOAP请求(通过'http://url.co.uk/_vti_bin/Lists.asmx?WSDL)。我使用 NTLM 身份验证让它正常工作(这很痛苦,但最终有效),但现在该项目的职责是通过 CLAIMS 进行身份验证,以便它适用于 SharePoint 安装或 office365 实例。

我从一开始就意识到标准的 SOAP 身份验证是行不通的......但我还是试过了!不出所料,我收到了一个错误返回"列出错误代码:HTTPList 错误字符串:禁止"。

是否有可能通过基于纯PHP/SOAP的解决方案通过声明进行身份验证,如果是这样,实现这一目标的最佳方法是什么?我已经阅读了有关共享点的声明身份验证的各种文章,其中包含使用Apache技巧等进行身份验证的各种解决方案。我正在从事的项目要求这是一个纯粹的PHP解决方案。

值得指出的是,我不是 MS 开发人员,对 CLAIMS 身份验证的了解有限(这可能没有帮助!

这里有一些更多信息(特定于 PHP),也可能有所帮助。我自己还没有尝试过,所以不能说它是否真的有效:

http://macfoo.wordpress.com/2012/06/23/how-to-log-into-office365-or-sharepoint-online-using-php/

http://allthatjs.com/2012/03/28/remote-authentication-in-sharepoint-online/

http://davidsit.wordpress.com/2010/02/23/reading-a-sharepoint-list-with-php/

phpSPO - SharePoint Client for PHP library允许您使用基于 REST/OData 的 API for SharePoint Online 对 SharePoint 列表数据执行 CRUD 操作。

当前版本支持使用基于声明的身份验证的 SharePoint Online。

例子

如何在 SharePoint Online (SPO) 中执行身份验证:

try {
    $client = new SPOClient($url);
    $client->signIn($username,$password);
    echo 'You have been authenticated successfully'n';
}
catch (Exception $e) {
    echo 'Authentication failed: ',  $e->getMessage(), "'n";
}

我还没有看到任何PHP的例子 - 这些例子解释了这个过程,并给出了一个用C#实现的实现,应该可以用PHP重写。

http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx

http://code.msdn.microsoft.com/Remote-Authentication-in-b7b6f43c

http://blogs.msdn.com/b/cjohnson/archive/2011/05/14/part-2-headless-authentication-with-sharepoint-online-and-the-client-side-object-model.aspx