Microsoft Teams SSO-无法检索令牌

发布于 2025-01-21 05:54:38 字数 1098 浏览 6 评论 0原文

我正在尝试在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);
                    },
                });

但我仍然无法获取令牌,我一直在下面获取错误,请让我知道我在做什么错误

”错误doken

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

Error getting token

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁我热情 2025-01-28 05:54:38
  • 请确保授予特定资源的权限
    同意该应用程序。检查是否在Azure AD Portal中添加了访问团队的权限并获得同意。
  • 并且请重新检查资源参数是正确的
    domaina和“资源”中的客户端ID:“ api:// {您的Tab App域}/{AAD应用程序client ID}”

corueteness:

  1. understanding-azure-ad-single-sign-on-for -microsoft-teams-apps
  2. 特定于资源的符合
  • Please make sure that the resource specific permissions are granted
    consent to the application.Check if permissions to access teams are added in azure ad portal and granted consent .
  • And please recheck the resource parameter is correct by comparing the
    domaina and the client id in "resource": "api://{Your tab app domain}/{AAD App client id}"

References:

  1. understanding-azure-ad-single-sign-on-for-microsoft-teams-apps
  2. resource-specific-consent
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文