首页 > 解决方案 > 尝试在 VS Code 中将 SPGo 连接到 SP Online 时出现 InternalServiceFault

问题描述

我正在尝试将 Visual Studio Code 中的 SPGo 插件连接到 Sharepoint Online 站点。有很多指南,例如这个:https ://medium.com/niftit-sharepoint-blog/saying-goodbye-to-sharepoint-designer-ac939a0b79ba

简而言之,我这样做是这样的:

  1. 打开 VS 代码
  2. 打开一个本地的空文件夹)

  3. SPGO:配置工作区(按照指南,以 spgo.json 结尾,看起来像我粘贴的那个)

  4. SPGO:填充本地工作区(要求我提供凭据,然后我以 O365 样式(电子邮件和密码)绘制它。
  5. 状态栏显示“填充工作区”

大约 10 秒后,我在输出窗口 (spgo) 中收到粘贴错误

我正在使用最新版本:

我在我的租户中尝试了各种站点,我知道它们已经启动。我是网站的网站集管理员。当然,我知道凭据是正确的。更改时,remoteFolders 和 publishingScope 不会影响任何内容。我假设 authenticationType 应该是“摘要”。

SPGo.json:

{
    "sourceDirectory": "src",
    "sharePointSiteUrl": "https://domain.sharepoint.com/sites/SiteName",
    "publishingScope": "Major",
    "authenticationType": "Digest",
    "remoteFolders": [
        "/SitePages/"
    ]
}

我没有在本地文件夹中获得任何文件,而是在输出中收到错误:

================================     ERROR     ================================

<s:Fault>
  <s:Code>
    <s:Value>s:Receiver</s:Value>
    <s:Subcode>
      <s:Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</s:Value>
    </s:Subcode>
  </s:Code>
  <s:Reason>
    <s:Text xml:lang="en-US">The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug&gt; configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.</s:Text>
  </s:Reason>
</s:Fault>
Error Detail:
----------------------
{}
===============================================================================

标签: visual-studio-codesharepoint-online

解决方案


对不起,我错过了这个帖子这么久。首先-感谢您的详细撰写。这是我第一次看到 SPGo 的这个特定问题,所以我不确定根本原因是什么。

几个问题:

  1. 您是否对 Office 365/SharePoint Online 实例使用 ADFS 身份验证?
  2. 您能否在此 SP 站点上使用仅插件身份验证?

SPGo 应该能够在 SharePoint Online 中自动使用 ADFS,但作为后备,您可以使用 Addin-Only 身份验证。在这种情况下,您将为您正在访问的 SharePoint 网站集创建一个 ClientId 和 ClientSecret 对,并使用这些凭据进行身份验证。ClientId 将充当您的用户名,ClientSecret 将充当您的密码。

在幕后,我使用 node-sp-auth 包进行用户身份验证。Sergei(Github 上的 s-KaiNet)在他的网站上写了一篇关于如何在 SharePoint Online 中启用仅插件身份验证的精彩文章,您可以在此处找到。

感谢您使用 SPGo!


推荐阅读