如何从不同域中使用CSOM检索列表项并显示? [英] How to retrieve List item and display using CSOM from different domain?
问题描述
We have different domain xyz.com and we can browse the contents of xyz.com sharepoint site using ADFS of abc.com using Single sign-on.
问题是,当我们只有abc.com访问权限时,如何在xyz.com中访问共享点列表?
The Problem is how to get access the sharepoint list in xyz.com when we have only abc.com access?.
如何使用上述基于abc.com的用户使用基于CSOM的模型在xyz.com中检索列表项?
How to retrieve the list item in xyz.com using this CSOM based model with above said abc.com user?
关于约翰·扎卡里亚(John Zachariah)
Regards, John Zachariah
推荐答案
在SharePoint客户端对象模型中,将abc.com有效的用户凭据传递给ClientContext对象,如下所示:
In SharePoint Client Object Model, pass abc.com valid user credential to ClientContext object like below:
using (ClientContext context = new ClientContext("http://yourserver/"))
{
context.Credentials = new NetworkCredential("user", "password", "domain");
}
有关使用SharePoint Client Object Model获取列表项的更多信息,这是一个演示供您参考:
More information about getting list item using SharePoint Client Object Model , here is a demo for your reference:
http://www.c-sharpcorner.com/blogs/caml-query-to-retrieve-the-items-from-a-list-using-csom1
谢谢
最好的问候
这篇关于如何从不同域中使用CSOM检索列表项并显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!