我将我的用户发送到
/authorize
,然后我得到一个访问令牌。我完成了吗?我现在可以代表用户发送电子邮件并创建日历活动吗?或者我现在必须将它们发送到/token
?
如果我只能从
/token
获取令牌,为什么 /authorize
还会存在?
根据您的描述,我假设您想知道 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.
我们可以使用此代码来获取经过身份验证的访问令牌。
参考
OAuth2.0文档以了解有关授权和身份验证的更多信息。
https://developer.okta.com/blog/2019/10/21/illusterated-guide-to-oauth-and-oidc
/token
是步骤 6,而
/authorize
是步骤 5。