吊销访问令牌 /刷新令牌,撤销其他代币,并具有不同的权限

发布于 2025-02-13 00:41:25 字数 554 浏览 3 评论 0原文

我正在使用两套Google API,并且权限一组用于Google日历,而另一组是Google Cloud Console中同一OAuth 2.0客户端的Google驱动器。

从获取令牌到撤销,我都关注这篇文章。 它说撤销访问令牌或刷新代币将发布请求发送到https://oauth2.googleapis.com/revoke.com/revoke with header contem> content-type:application/x-www-form -urlencoded和param token = {token}

当我按照该过程撤销Google Drive的令牌时用户他们的Google日历令牌也被撤销,反之亦然。我不确定这是过去的行为还是最近的更新以及如何处理?

I am working with two sets of Google APIs and permissions one is for Google Calendar and another one is for Google Drive from the same OAuth 2.0 Client in the Google Cloud console.

From obtaining tokens to revoking I'm following this article.
where it says to revoke an access token or refresh token send a post request to https://oauth2.googleapis.com/revoke with header Content-type:application/x-www-form-urlencoded and param token={token}

When I follow the process to revoke a token for Google Drive for a user their Google Calendar token also got revoked and vice versa. I'm not sure if it's a behavior from past or it's a recent update and how to deal with it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随心而道 2025-02-20 00:41:25

Revoke将撤销用户访问您的应用程序。不管您要求访问什么API范围,所有这些。它不受单个范围的限制。

我的问题是为什么您有两个代币适用于同一用户。为什么不只是一次请求驱动器和日历访问用户一次,并有一个令牌授予您对两个API的访问?

Revoke will revoke a users access to your application. All of it no matter what api scope you requested access for. Its not limited by a single scope.

My question is why you have two tokens for the same user. Why not just request drive and calendar access of the user once and have a single token granting you access to both apis?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文