使用/ oauth2 / token MS Azure API生成令牌会返回ADSS50034错误

时间:2019-06-26 10:34:05

标签: microsoft-graph

我尝试使用https://login.microsoftonline.com/ {tenantid} / oauth2 / token获取访问令牌,但我收到“ AADSTS50034:Outlook.com目录中不存在用户帐户{EmailHidden}。登录此应用程序,必须将帐户添加到目录

https://login.microsoftonline.com/{tenantid}/oauth2/token
username:
password:
client_id:
client_secret:
grant_type:password
scope:openid profile
resource:https://graph.microsot.com/directory.read.all

我收到如下所示的错误

{
    "error": "invalid_grant",
    "error_description": "AADSTS50034: The user account {EmailHidden} does not exist in the outlook.com directory. To sign into this application, the account must be added to the directory.\r\nTrace ID: 63e89d55-afa7-4787-b8b0-cdfa605f0f00\r\nCorrelation ID: e4b72b0e-9731-4427-9378-3c38aa6be96a\r\nTimestamp: 2019-06-26 10:24:38Z",
    "error_codes": [
        50034
    ],
    "timestamp": "2019-06-26 10:24:38Z",
    "trace_id": "63e89d55-afa7-4787-b8b0-cdfa605f0f00",
    "correlation_id": "e4b72b0e-9731-4427-9378-3c38aa6be96a"
}

必须作为响应返回访问令牌,但是我没有将用户添加到应用程序错误中。请提出建议。

1 个答案:

答案 0 :(得分:1)

使用个人Microsoft帐户登录的用户不能使用资源所有者密码凭据(ROPC)流程。