android - 如何撤销/取消授予 Android 设备上的应用程序的帐户授权

标签 android google-api google-calendar-api google-api-client android-account

我正在研究与 Google Calendar API 的集成。为了获得访问特定帐户日历的授权,我使用了 Calendar-Android-Sample 项目中的这个 fragment :

if (e instanceof UserRecoverableAuthIOException) {
    Intent intent=((UserRecoverableAuthIOException) e).getIntent();
activity.startActivityForResult(intent, REQUEST_AUTHORIZATION);
    return;
}

由于某种原因,示例项目返回“access-not-configured”错误消息,而我的工作正常,并且我遵循了示例项目中采取的相同步骤,也许是因为我的是另一个项目。

我面临的问题是重复API的授权步骤,因为如果我已经在设备上授权访问,那么即使我从该设备上卸载应用程序,下次我安装它时,它也是授权,我不需要再次通过授权步骤。

为了保持一致性,我希望能够撤销对应用程序的授权,这样下次我运行任何 API 调用时,我就必须对应用程序进行授权。

如何实现?

谢谢, 亚当。

最佳答案

这里回答了重复的问题:

Where to revoke Google API permissions granted on Android?

似乎不是一种以编程方式执行此操作的方法。但发现您似乎需要从 Google 撤销第三方访问权限(即您的程序)。

转到 https://accounts.google.com/b/0/IssuedAuthSubTokens

或者

    1.) Sign in on the Google Accounts homepage.
    2.) Click Security on the left-hand side of the page.
    3.) Scroll down to the Connected applications and sites section and click the Manage access button.
    4.) Click Revoke Access next to the service you want to disconnect from your account.

现在您应该看到一个应用程序(希望命名为您设置的应用程序名称)使用日历 API,撤消此访问权限和您的好处。

关于android - 如何撤销/取消授予 Android 设备上的应用程序的帐户授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16744162/

相关文章:

google-api - Google 表格 API V4 代码 503 "UNAVAILABLE"

ios - Google 日历 API iOS 快速入门

android - Advanced Silicon CoolTouch USB 触摸屏不适用于 Android 4.0.4

android:通过 adb 操作屏幕锁定设置?

php - 未捕获的异常 InvalidArgumentException ,消息为未找到指定的配置文件 : adsapi_php. ini - Google Adwords API

javascript - 如何使用 CSS 自定义 Google 日历?

c# - Google Calendar V3 2 腿认证失败

google-calendar-api - 在谷歌日历(API)中插入多个 calendar.events

android - 哪里可以下载android.widget.Gallery的源码?

java - checkBox.setOnCheckedChangeListener 调用使应用程序崩溃?