【问题标题】:How to revoke/cancel account authorization given to an application on an Android device如何撤销/取消授予 Android 设备上应用程序的帐户授权
【发布时间】:2013-05-24 21:54:59
【问题描述】:

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

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

由于某种原因,示例项目返回“访问未配置”错误消息,而我的工作,我已经按照示例项目中的相同步骤进行操作,可能是因为我的项目是另一个项目。

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

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

如何做到这一点?

谢谢, 亚当。

【问题讨论】:

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


    【解决方案1】:

    这里回答了重复的问题:

    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 的应用程序(希望命名为您设置的应用程序名称)撤消了此访问权限和您的好处。

    【讨论】:

      猜你喜欢
      • 2013-02-13
      • 1970-01-01
      • 2016-10-07
      • 1970-01-01
      • 1970-01-01
      • 2013-03-23
      • 2015-01-13
      • 1970-01-01
      • 2012-01-23
      相关资源
      最近更新 更多