无法在 iFrame/MS Teams 自定义选项卡中使用标识平台



我正在尝试使用身份平台对用户进行身份验证到我的自定义应用程序中,该应用程序将在 MS Teams 中使用。

我知道团队使用 iFrame 加载自定义应用。所以我遵循了常见问题解答 - Q5 中提到的方法。我在MSALConfig中使用了redirectUri属性。我正在使用 MS 提供的索引文件进行测试,方法是在 iFrame 标签中调用它。

在 acquireTokenSilent 和 acquireTokenPopup 这两种情况下,它都会卡在加载重定向页面的弹出窗口中。身份验证既未完成,也未关闭弹出窗口。

以下步骤可以取消阻止桌面/移动应用的 Teams 选项卡方案。

手动步骤

第 1 步。确保已在租户管理站点上的新"API 权限管理"页中批准请求。这会在后台创建客户端密码。

第 2 步。转到 ->https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview

第 3 步。单击"SharePoint Online 客户端扩展性 Web 应用程序主体

"第 4 步。点击左侧菜单上的清单

第5步。从 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": "00000003-0000-0ff1-ce00-000000000000",
"permissionIds": [
"ID OF THE USER_IMPERSONATION Scope"
]
}
],

步骤 7.点击保存。

此问题已通过将实现更改为使用新功能 - SSO 而不是 MSAL 库来解决。

最新更新