Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从内部SharePoint 2013和ADFS获取FedAuth Cookie_C#_Sharepoint_Cookies_Adfs2.0 - Fatal编程技术网

C# 如何从内部SharePoint 2013和ADFS获取FedAuth Cookie

C# 如何从内部SharePoint 2013和ADFS获取FedAuth Cookie,c#,sharepoint,cookies,adfs2.0,C#,Sharepoint,Cookies,Adfs2.0,我使用windows server 2012 R2、ADFS和sharepoint 2013设置了一个测试环境。我可以使用ADFS作为索赔身份提供者成功登录Sharepoint 2013。现在我正试图从我的C#应用程序登录Sharepoint 我能够使用以下命令从adfs请求saml断言令牌 现在,我想帮助您将saml令牌发布到SharePoint并检索FedAuth cookie,以便被动登录SharePoint 2013并从C#应用程序上载文档 当我调用最后一个方法PostSharePoin

我使用windows server 2012 R2、ADFS和sharepoint 2013设置了一个测试环境。我可以使用ADFS作为索赔身份提供者成功登录Sharepoint 2013。现在我正试图从我的C#应用程序登录Sharepoint

我能够使用以下命令从adfs请求saml断言令牌

现在,我想帮助您将saml令牌发布到SharePoint并检索FedAuth cookie,以便被动登录SharePoint 2013并从C#应用程序上载文档

当我调用最后一个方法PostSharePointSTS()时,没有设置Cookies

HTTP/1.1 302 Found
Content-Length: 0
Content-Type: text/html; charset=utf-8
Location: https://logon.2012r2.local:443/adfs/ls/wia?wa=wsignin1.0&wtrealm=urn:sharepoint:portal
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 16 Aug 2014 10:55:51 GMT

    This response did not set any cookies.
This response did not contain a P3P Header.

Validate P3P Policies at: http://www.w3.org/P3P/validator.html
Learn more at: http://fiddler2.com/r/?p3pinfo
大部分代码都得到了


为什么不使用标准的SharePoint CSOM库在SharePoint中执行您想要的任何操作?CSOM在SharePoint端自动代表用户进行所有必要的ADFS交互。

您是否找到了解决此问题的方法?您能否提供一个这样的例子?我发现事实正好相反。事实上,有很多方法可以设置联合身份验证,但它们都没有提供实现。您想实现什么?你写道:“现在我正试图从我的C#应用程序登录Sharepoint。”那么接下来呢?“登录”不是目的,你显然想在那里做点什么:上传文件,阅读列表项目,等等。
HTTP/1.1 302 Found
Content-Length: 0
Content-Type: text/html; charset=utf-8
Location: https://logon.2012r2.local:443/adfs/ls/wia?wa=wsignin1.0&wtrealm=urn:sharepoint:portal
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 16 Aug 2014 10:55:51 GMT

    This response did not set any cookies.
This response did not contain a P3P Header.

Validate P3P Policies at: http://www.w3.org/P3P/validator.html
Learn more at: http://fiddler2.com/r/?p3pinfo