json - Microsoft Graph API 正在为 MSA 用户返回未知错误

我们使用 Microsoft V2.0 OpendID 协议(protocol)作为 SSO 方法,使 MSA 和 AAD 用户登录我们的应用程序。

以下是我们在授权 URL 中使用的范围

openid profile email user.read

在用户同意后,使用我们从 token API (/oauth2/v2.0/token -- scope = user.read) 获得的访问 token ,我们正在让 Microsoft Graph 调用 https://graph.microsoft.com/v1.0/me 以获取电子邮件和其他用户信息。

直到 2018 年 3 月 12 日,上述调用按预期工作。但是从 2018 年 3 月 13 日开始,我们发现 API 出现了奇怪的行为。

对于新来我们应用程序登录的 MSA 用户,https://graph.microsoft.com/v1.0/me 抛出以下错误。

错误一:

{
    "error": {
        "code": "RetryWithPuid",
        "message": "Please retry With PUID in either token or URL",
        "innerError": {
            "request-id": "18386e9b-c30e-459d-b816-f67f4a843874",
            "date": "2018-03-14T10:42:11"
        }
    }
}

错误 2:

{
    "error": {
        "code": "UnknownError",
        "message": "{\r\n  \"ErrorCode\": \"ErrorUserResolutionFailedAfterMailboxSuccessfullyProvisioned\",\r\n  \"Message\": \"Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileNotFoundException' was thrown.\",\r\n  \"Target\": null,\r\n  \"Details\": null,\r\n  \"InnerError\": null,\r\n  \"InstanceAnnotations\": []\r\n}",
        "innerError": {
            "request-id": "23c18edc-d451-4056-ab7c-0c23fb7b77f5",
            "date": "2018-03-14T08:03:11"
        }
    }
}

以上错误是不稳定的。对于已经登录我们应用程序的用户(3 月 12 日之前),我们没有看到上述问题。

我找不到关于上述错误的任何信息。

最佳答案

我现在面临同样的问题,我们之前没有收到此错误。 我在做一些测试时找到了一种让它工作的方法,但还没有找到合适的解决方案。

步骤是:

  • 转到 https://developer.microsoft.com/en-us/graph/graph-explorer
  • 使用用户登录,然后在“入门”下运行我的个人资料查询
  • 返回您的应用并尝试登录,错误消失了

https://stackoverflow.com/questions/49284516/

相关文章:

java - Spring Boot - 无法加载 keystore 类型 [PKCS12]

javascript - 多个实例或子包中的 Axios 默认 header

angular - 如何将 与路由一起使用?

powershell - 'Install-Module' : is not recognized

java - Spring/JPA 多线程死锁

php - 在 Laravel 5 迁移中更新表并添加数据

android - 在 ViewPager 中加载具有不同数据的相同 fragment

python - 如何收集 Django 的钱

python - Keras 文本分类 : Validation Accuracy doesn't

dart - 将谷歌日历插入 flutter 移动应用程序