获取用户租户列表的情况。当用户登录他所属的目录时,不会发生异常。否则,它会执行此操作,但该用户会作为 guest 分配到该目录。
Exception: {
"error":"invalid_grant",
"error_description":"AADSTS50034: To sign into this application the account must be added to the GUID directory.\r\nTrace ID: GUID\r\nCorrelation ID: GUID\r\nTimestamp: 2017-08-03 14:32:32Z",
"error_codes":[50034],
"timestamp":"2017-08-03 14:32:32Z",
"trace_id":"GUID",
"correlation_id":"GUID"
}
堆栈显示在 AcquireTokenSilentAsync 上。
最佳答案
如果您没有开发 Multi-Tenancy 应用,要从 Azure AD 获取 token ,用户登录应该在该租户中。
如果您正在开发 Multi-Tenancy 应用程序,我们应该在授权/ token 请求中将租户替换为 common
(请参阅 this link )。
更新
关于azure - “AADSTS50034 : To sign into this application the account must be added to the <GUID> directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45487492/