这个问题非常类似于先前在StackOverflow上提出的一个问题。然而,我得到的错误是不同的。
AadHttpClient fails when loading SP page with SPFx webpart in MSTeams Desktop Client
我还有一个共享点在线站点,其中有一个SPFx web部件,它使用了
如果我从浏览器导航到Sharepoint站点,或者打开MS Teams客户端,这个web部件就能工作。
一瞥我的设置:

以下是我所面临的问题的“复制步骤”概述。
将web部件部署到SharePoint
F 219
当我调试MS Team桌面客户端时,我在“网络请求”选项卡中调用了以下内容:
https://{mytenant}.sharepoint.com/sites/{mysite}/_api/Microsoft.SharePoint.Internal.ClientSideComponent.Token.AcquireOBOToken?resource={GUID of my AAD app registration}&clientId={GUID of SharePoint Online Client Extensibility AAD app registration}
答复如下:
错误403:
{“odata.error”:{“代码”:“-2147024891,System.UnauthorizedAccessException",”消息“:{”lang“:”en-US“,”odata.error“:”访问被拒绝。您没有执行此操作或访问此资源的权限“}}
一个有趣的观察是,这个web请求只发生在微软团队桌面客户端。
我想知道为什么这只发生在MS团队桌面客户端,而不是在MS团队web客户端或Sharepoint Online上。
更新: 10/02/2020
另一个注意事项:我们在不同的租户(个人租户而不是公司租户)上尝试了相同的设置。我们注意到,当MFA打开Azure Active Directory时,也可以复制相同的行为。
失败的请求是:
https://{personal tenant}.sharepoint.com/sites/{site name}/_api/Microsoft.SharePoint.Internal.ClientSideComponent.Token.AcquireOBOToken?resource={GUID of the AD app registration}&clientId={GUID of the SPO Client Extensibility app registration}
但是,现在返回的错误是一个具有响应的500:
{“odata.error”:{“代码”:“-1,System.AggregateException",”消息“:{”lang“:”en-US“,”value“:”发生了一个或多个错误“}}
发现了类似的问题,(但不同的错误)出现在Github:https://github.com/SharePoint/sp-dev-docs/issues/4915上。
发布于 2020-03-25 17:05:14
最近,我遇到了类似的问题,因为一个叫graphAPI的网站部件。在桌面团队中,这个电话从来不会发生,而且还会被卡住。我能够通过以下步骤来解决这个问题:
步骤1.访问租户管理站点上的新API权限管理页。这在幕后创建了一个客户端秘密。
步骤2.转到-> https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps
步骤3.单击SharePoint Online Client Extensibility Web Application Principal
步骤4.单击左侧菜单步骤5中的Manifest。从oAuth2Permission数组复制id
"oauth2Permissions": [
{
"adminConsentDescription": "Allow the application to access SharePoint Online Client Extensibility Web Application Principal on behalf of the signed-in user.",
"adminConsentDisplayName": "Access SharePoint Online Client Extensibility Web Application Principal",
"id": "2143704b-186b-4210-b555-d03aa61823cf",
"isEnabled": true,
"lang": null,
"origin": "Application",
"type": "User",
"userConsentDescription": "Allow the application to access SharePoint Online Client Extensibility Web Application Principal on your behalf.",
"userConsentDisplayName": "Access SharePoint Online Client Extensibility Web Application Principal",
"value": "user_impersonation"
}
],步骤6.用以下json替换“preAuthorizedApplications”条目。保留appId如下所写的内容。
"preAuthorizedApplications": [
{
"appId": "00000003-0000-0ff1-ce00-000000000000",
"permissionIds": [
"YOUR COPIED ID FROM STEP 5"
]
}
],第七步点击保存。
如果这对你有用的话请告诉我。我从https://github.com/SharePoint/sp-dev-docs/issues/3923#issuecomment-514726341引用了上述步骤
发布于 2022-03-30 11:08:45
最后,我有一个解决办法:
删除应用程序
为什么?
授予的。
https://stackoverflow.com/questions/59860729
复制相似问题