验证Office 365 SharePoint Online OOTB服务 [英] Authenticating Office 365 SharePoint Online OOTB services

查看:185
本文介绍了验证Office 365 SharePoint Online OOTB服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SharePoint数据消费到非.Net平台中.我已经为此目的使用了SharePoint OOTB服务,如Lists.asmx,Webs.asmx和search.asmx. 我已经成功添加了对使用Authentication.asmx的基于表单的身份验证的支持. 现在,我想为Office 365 SharePoint Online提供支持.为此,我正在使用一个演示SharePoint Online网站. 我面临的问题是,当我使用Authentication.asmx的Mode方法时,得到"Forms"作为响应:

I want to consume SharePoint data into a non .Net platform. I already use the SharePoint OOTB services like Lists.asmx, Webs.asmx and search.asmx for this purpose. I have successfully added support for forms based authentication using Authentication.asmx. Now, I want to provide support for Office 365 SharePoint online. For that purpose I have a demo SharePoint Online site that I am working on. Problem, I am facing is when I use Mode method of Authentication.asmx I get ‘Forms’ in response:

<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"错误,相同的凭据在浏览器中正常工作.

However when I use Login.asmx and pass correct username and password, I get ‘PasswordNotMatch’ error, the same credentials are working fine in browser.

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

Note:- This works perfect for a FBA non Office 365 SharePoint site.

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

Could somebody please help me in implementing the support for Office 365 SharePoint Online OOTB services?

推荐答案

我一直在寻找类似的想法,并且

I've been looking into a similar idea and this thread has been extremely helpful. They actually have a webservice sample using the PInvoke, it might help you get there.

编辑:我的搜索使我进入

my search led me to this other post by Wictor Wilen, but trying to avoid the ClientOM for now.

Edit2 :好了,这个工作正常了.使用上面Wictor中的代码,我下载了他的示例解决方案并将"MsOnlineClaimsHelper.cs"和"WcfClientContracts.cs"移到我的项目中,稍后我将对这些文件中真正使用的东西有所了解.我只更改了它们以删除ClientOM引用,包括clientContext_ExecutingWebRequest方法.

alright, got this working. Using the code from Wictor above, I downloaded his sample solution and moved "MsOnlineClaimsHelper.cs" and "WcfClientContracts.cs" to my project, I will be fiddling with what is really used from these files later. I only changed them to remove the ClientOM references including the clientContext_ExecutingWebRequest method.

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

In a sample MVC3 app or Console app:

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);
}

这篇关于验证Office 365 SharePoint Online OOTB服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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