【发布时间】:2021-05-14 16:08:16
【问题描述】:
我正在使用多租户团队应用程序,并希望使用 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,我们正在调查并与我们的内部团队核实,我们会尽快为您更新。
-
这个问题是从githubgithub.com/OfficeDev/microsoft-teams-library-js/issues/532跟踪的。
-
@entropic - 你能解决你的问题吗?我遇到了同样的错误。你是如何让它在开发环境中工作的。您遵循的所有步骤。您遵循的任何文档?
-
@Anand 它对我来说仍然坏掉,昨天刚刚尝试过,并将错误附加到 Jagadeesh 提供的链接上。与此同时,我不再使用 SSO 而是执行身份验证弹出窗口。
标签: reactjs botframework microsoft-teams