Microsoft 帐户 OpenID 身份验证令牌请求 returns id_token 但不是 access_token

Microsoft Account OpenID authentication token request returns id_token but not access_token

https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols-oauth-code

的文档中

...它表示对令牌请求的成功响应如下所示:

{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1Q...",
    "token_type": "Bearer",
    "expires_in": 3599,
    "scope": "https%3A%2F%2Fgraph.microsoft.com%2Fmail.read",
    "refresh_token": "AwABAAAAvPM1KaPlrEqdFSBzjqfTGAMxZGUTdM0t4B4...",
    "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIyZDRkMTFhMi1mODE0LTQ2YTctOD...",
}

身份验证的第一步完成后,我在重定向上收到一个代码,并用它来请求令牌。

然而,我只收到这个:

{
    "token_type": "Bearer",
    "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIyZDRkMTFhMi1mODE0LTQ2YTctOD...",
}

我的范围设置为openid email profile

为什么我没有收到 access_token

只有在请求资源特定范围时才会返回访问令牌,以便它可以用来访问受保护的资源。尝试包括一个像“https://graph.microsoft.com/mail.read”这样的范围,如随问题一起发布的文档 link 中的示例所示。