Microsoft Teams SSO-无法检索令牌
我正在尝试在Microsoft Teams任务模块中检索逻辑上的SSO令牌强>
有人知道如何解决这个问题吗?
应用内清单,我的资源定义为:
"webApplicationInfo": {
"id": "aedd2c2b-545f-4539-9437-8776",
"resource": "api://subdomain.domain.com/aedd2c2b-545f-4539-9437-8776"
},
在Azure中,我在Azure Active Directory中创建的应用程序中定义了范围,这是以下代码,
microsoftTeams.initialize()
microsoftTeams.authentication.getAuthToken({
successCallback: (token: string) => {
this.setState({ token });
this._setAppContextFromMSTContext({ token });
},
failureCallback: (error) => {
this.showAuthenticationError();
logger.error(`Error getting token`, error);
},
});
但我仍然无法获取令牌,我一直在下面获取错误,请让我知道我在做什么错误
I am trying to retrieve an SSO token in my Microsoft Teams task module for a logic am working on and when I use the Microsoft teams SDK I keep getting the error App resource defined in the manifest and iframe origin do not match
Does anyone have an idea of how to fix this?
In-app manifest, I have my resources defined as:
"webApplicationInfo": {
"id": "aedd2c2b-545f-4539-9437-8776",
"resource": "api://subdomain.domain.com/aedd2c2b-545f-4539-9437-8776"
},
In Azure, I have my scope defined in the app created in Azure Active Directory and this is the code below
microsoftTeams.initialize()
microsoftTeams.authentication.getAuthToken({
successCallback: (token: string) => {
this.setState({ token });
this._setAppContextFromMSTContext({ token });
},
failureCallback: (error) => {
this.showAuthenticationError();
logger.error(`Error getting token`, error);
},
});
But I still can't fetch the token, I keep getting the error below, please let me know what else I am doing wrong
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
同意该应用程序。检查是否在Azure AD Portal中添加了访问团队的权限并获得同意。
domaina和
“资源”中的客户端ID:“ api:// {您的Tab App域}/{AAD应用程序client ID}”
corueteness:
consent to the application.Check if permissions to access teams are added in azure ad portal and granted consent .
domaina and the client id in
"resource": "api://{Your tab app domain}/{AAD App client id}"
References: