Microsoft Graph 中的 /token 和 /authorize 有什么区别?

Ask*_*ous 3 openid oauth-2.0 microsoft-graph-api

我将用户发送到/authorize并获取访问令牌。我完成了吗?我现在可以代表用户发送电子邮件并创建日历活动吗?或者我现在必须将它们发送到/token

/token如果我只能从中获取令牌,为什么还要存在/authorize

小智 6

根据您的描述,我假设您想知道 Microsoft Graph 中 /token 和 /authorize 之间的区别。

根据本文档,当我们想要获取访问令牌时,我们应该与两个端点交换 HTTP 请求。

The /authorize endpoint, where your app can send a user to authenticate with Azure AD and consent to the permissions your app needs. The /token endpoint where your app can get an access token once user consent has been granted.

这意味着 /authorize 端点正在请求用户授予适当的权限。然后,服务器将返回一个代码。

我们可以使用此代码来获取经过身份验证的访问令牌。

OAuth2.0 的参考文档,了解有关授权和身份验证的更多信息。