简体   繁体   English

安装了Android的应用:撤销对Google帐户的OAuth2访问

[英]Android installed app: Revoking OAuth2 access to Google Account

I've installed an Android application. 我已经安装了Android应用程序。 The first time I ran it an OAuth2 window showed up asking me whether I wanted to grant the application access to some scope within my user account. 第一次运行它时,出现一个OAuth2窗口,询问我是否要授予应用程序对用户帐户中某个范围的访问权限。

However now I've gone to https://accounts.google.com/b/0/IssuedAuthSubTokens?hl=en and revoked access, but my application still runs normally without asking me the question of whether to allow it access to my account or not. 但是,现在我去了https://accounts.google.com/b/0/IssuedAuthSubTokens?hl=zh-CN并撤消了访问权限,但是我的应用程序仍然可以正常运行,而没有问我是否允许它访问我的帐户的问题或不。

The application is the sample Auth activity that comes with Google Play extras. 该应用程序是Google Play其他功能随附的示例Auth活动。

What can I do to get the application to display the question in a popup window again? 如何使应用程序再次在弹出窗口中显示问题? I've tried uninstalling and reinstalling but I cannot get that window back and I need it for testing purposes. 我尝试卸载并重新安装,但是无法找回该窗口,并且出于测试目的需要它。

Thanks. 谢谢。

Try to programmatically revoke the token by making a request to - https://accounts.google.com/o/oauth2/revoke and include the token as a parameter. 通过作出请求以编程方式撤销令牌- https://accounts.google.com/o/oauth2/revoke和包括令牌作为参数。 Something like this :: 像这样的东西::

curl https://accounts.google.com/o/oauth2/revoke?token= {token} curl https://accounts.google.com/o/oauth2/revoke?token= {token}

The token can be an access token or a refresh token. 令牌可以是访问令牌或刷新令牌。 If the token is an access token and it has a corresponding refresh token, the refresh token will also be revoked. 如果令牌是访问令牌,并且具有相应的刷新令牌,则刷新令牌也将被吊销。

If the revocation is successfully processed, then the status code of the response is 200. For error conditions, a status code 400 is returned along with an error code. 如果撤消已成功处理,则响应的状态代码为200。对于错误情况,将返回状态代码400和错误代码。

The error code will give you an idea if the revocation was successful or not. 错误代码将使您了解撤销是否成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM