加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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

发布时间:2020-12-14 18:34:56 所属栏目:资源 来源:网络整理
导读:我想将SharePoint数据用于非.Net平台.为此,我已经使用了像Lists.asmx,Webs.asmx和search.asmx这样的SharePoint OOTB服务. 我已使用Authentication.asmx成功添加了对基于表单的身份验证的支持. 现在,我想在线提供对Office 365 SharePoint的支持.为此,我有一个
我想将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/","admin@my365site.onmicrosoft.com","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);
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读