我们使用 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://stackoverflow.com/questions/49284516/