gpt4 book ai didi

Windows Azure : AD app for external access throws error on token issue

转载 作者:行者123 更新时间:2023-12-03 03:18:10 24 4
gpt4 key购买 nike

我正在尝试构建 AzureAD 访问应用程序。我必须为外部租户启用此应用程序。我已在此应用程序上启用外部访问,并且它也配置为使用 Graph API。我已经在创建该应用程序的租户中测试了该应用程序,并且一切(auth+ graph api 访问)都有效。现在这是外部租户的流程

  • 我将外部租户用户带到我的应用的授予同意 URL,用户(外部租户的管理员)授予访问权限,我得到了正确的响应
  • 现在我想获取该用户的授权 token ,因此我通过

    让用户完成正常的 Oauth 流程
    https://login.windows.net/common/oauth2/authorize

其次是

    https://login.windows.net/common/oauth2/token/

此时Azure抛出以下错误

{"error":"invalid_grant","error_description":"AADSTS50000: There was an error issuing a 
token. AADSTS65005: No permission to access \u0027https://graph.windows.net\u0027
resource is configured for \u0027d2037ff7-24e4-4cac-8e5e-16e370b36238\u0027 application,
or it is expired or revoked.\r\nTrace ID: 472aa92f-35a2-4ed9-ab07-
12488cc9e6f5\r\nCorrelation ID: b163dde5-eac5-4c82-99ad-0e1100487cb9\r\nTimestamp: 2013-
09-23 05:28:41Z","error_codes":[50000,65005],"timestamp":"2013-09-23
05:28:41Z","trace_id":"472aa92f-35a2-4ed9-ab07-12488cc9e6f5","correlation_id":"b163dde5-
eac5-4c82-99ad-0e1100487cb9"}

为什么即使应用程序已被授予访问权限也会出现此错误。我尝试查找 STS 错误但没有找到解释。有什么想法吗?

[更新]

SAML 流程继续适用于外部租户,但即我可以使用该应用程序为此外部租户进行 SAML(SSO) 登录。问题似乎只是在访问图形 API 时出现。

最佳答案

尝试将 &prompt=consent&prompt=admin_consent 添加到完整的 authorize URL 以重新请求用户同意。我的经验是,同意将被随机撤销(可能是一个错误),并且永远不会自动重新请求(肯定是一个错误)。

关于Windows Azure : AD app for external access throws error on token issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18952822/

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