gpt4 book ai didi

reactjs - Microsoft Teams 选项卡 SSO getAuthToken 返回 resourceDisabled

转载 作者:行者123 更新时间:2023-12-04 13:52:51 26 4
gpt4 key购买 nike

我在一个 Multi-Tenancy 团队应用程序中工作,并想使用 SSO 向机器人添加一个选项卡。在我的开发环境中,这一切正常,我可以毫无问题地登录。当我将其部署到 QA 环境时,出现以下错误

AUTHMSAL: Event: adal:tokenRenewFailure, code: invalid_resource|AADSTS500011: The resource principal named api://[mydomain]/[myappid] was not found in the tenant named [tenant]. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.
Trace ID: d9eae514-36e0-4c28-afeb-3312133b0a01
Correlation ID: 82e84904-a4ef-490a-a114-b5efb68eb701
Timestamp: 2021-05-14 15:22:47Z, resource: api://[mydomain]/[myappid], action: resourceDisabled
我不确定为什么这会失败。我已经在 QA 中检查了租户并确认我的应用程序列在“企业应用程序”下,并且权限已被同意,并被授予管理员同意。我还检查了我的开发环境和 qa 环境的应用程序注册设置是否有任何差异(URI 名称除外),但没有。
这是我用来尝试检索 AuthToken 的代码
const authTokenRequest: microsoftTeams.authentication.AuthTokenRequest = {
successCallback: function (token: string) {
const decoded: { [key: string]: any; } = jwt.decode(token);
localStorage.setItem("name", decoded.name);
localStorage.setItem("token", token);
},
failureCallback: function (error: any) {
console.log("Failure on getAuthToken: " + error);
}
};

microsoftTeams.initialize(() => {
microsoftTeams.getContext((r) => {
microsoftTeams.authentication.getAuthToken(authTokenRequest);
});
});

有人能指出我哪里出错的正确方向吗?

最佳答案

@entropic @Anand @Jagadeesh-MSFT
我也遇到过类似的情况,收到了 资源禁用 错误来自 getAuthToken 当我测试基于 Microsoft 提供的示例创建的选项卡应用程序时
Microsoft Teams - Tabs Azure AD Single Sign-On Sample
[img] resourceDisabled returned from getAuthToken
我所做的是更正 中的 AppID webApplicationInfo.resource 元素根据这个
Manifest file has incorrect/static resource url #3
我现在可以得到正确的结果:
[img] getAuthToken is now successful
注意:我还将架构版本从 1.5 更新到 1.9,但似乎此更改与问题无关。

"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.9/MicrosoftTeams.schema.json",
"manifestVersion": "1.9",

关于reactjs - Microsoft Teams 选项卡 SSO getAuthToken 返回 resourceDisabled,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67537440/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com