Web服务 – 对Office 365 SharePoint Online OOTB服务进行身份验证

Web服务 – 对Office 365 SharePoint Online OOTB服务进行身份验证,第1张

概述我想将SharePoint数据用于非.Net平台.为此,我已经使用了像Lists.asmx,Webs.asmx和search.asmx这样的SharePoint OOTB服务. 我已使用Authentication.asmx成功添加了对基于表单的身份验证的支持. 现在,我想在线提供对Office 365 SharePoint的支持.为此,我有一个我正在研究的S​​harePoint Online网 我想将SharePoint数据用于非.Net平台.为此,我已经使用了像Lists.asmx,Webs.asmx和search.asmx这样的SharePoint OOTB服务.
我已使用Authentication.asmx成功添加了对基于表单的身份验证的支持.
现在,我想在线提供对Office 365 SharePoint的支持.为此,我有一个我正在研究的S​​harePoint Online网站.
问题,我面临的是当我使用Authentication.asmx的Mode方法时,我得到’Forms’作为回应:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>    <ModeResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">        <ModeResult>Forms</ModeResult>    </ModeResponse></soap:Body></soap:Envelope>

但是,当我使用Login.asmx并传递正确的用户名和密码时,我收到“PasswordNotMatch”错误,相同的凭据在浏览器中正常工作.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>    <LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">        <LoginResult>         <ErrorCode>PasswordNotMatch</ErrorCode>            <TimeoutSeconds>0</TimeoutSeconds>        </LoginResult>    </LoginResponse></soap:Body></soap:Envelope>

注意: – 这适用于FBA非Office 365 SharePoint站点.

有人可以帮我实现对Office 365 SharePoint Online OOTB服务的支持吗?

解决方法 我一直在寻找类似的想法,this thread非常有帮助.他们实际上有一个使用PInvoke的webservice示例,它可能会帮助你实现目标.

编辑:我的搜索引导我到this other post by Wictor Wilen,但现在试图避开ClIEntOM.

Edit2:好的,让这个工作.使用上面Wictor的代码,我下载了他的示例解决方案并将“MsOnlineClaimsHelper.cs”和“WcfClIEntContracts.cs”移动到我的项目中,稍后我将摆弄这些文件中真正使用的内容.我只更改了它们以删除ClIEntOM引用,包括clIEntContext_ExecutingWebRequest方法.

在示例MVC3应用程序或控制台应用程序中:

MsOnlineClaimsHelper claimsHelper = new MsOnlineClaimsHelper("https://my365site.sharepoint.com/sites/enterprise/","[email protected]","secret");using (var Lists = new SharePointLists.Lists()){    Lists.Url = @"https://my365site.sharepoint.com/sites/enterprise/_vti_bin/Lists.asmx";    Lists.cookieContainer = claimsHelper.cookieContainer;    var ListCol = Lists.GetListCollection();    VIEwBag.Message = ListCol.InnerXml;    //Console.Write(ListCol.InnerXml);}
总结

以上是内存溢出为你收集整理的Web服务 – 对Office 365 SharePoint Online OOTB服务进行身份验证全部内容,希望文章能够帮你解决Web服务 – 对Office 365 SharePoint Online OOTB服务进行身份验证所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1138767.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存