Where to revoke Google API permissions granted on Android?

后端 未结 8 1604
抹茶落季
抹茶落季 2021-01-04 21:54

I\'m working with some sample code here:

http://code.google.com/p/google-api-java-client/source/browse/picasa-android-sample/src/main/java/com/google/api/services/sa

相关标签:
8条回答
  • 2021-01-04 22:11

    Look into your AndroidManifest file.

    0 讨论(0)
  • 2021-01-04 22:12

    You can revoke account permissons on ...

    https://security.google.com/settings/security/permissions

    You can get there by [Account Settings] > [Account Permissions]

    Proof that this answer is the real deal:

    enter image description here

    0 讨论(0)
  • 2021-01-04 22:16

    It's not possible via any public, official API.

    See:

    • https://groups.google.com/forum/?fromgroups=#!topic/android-developers/gOVZ0DF7ccg
    • http://grokbase.com/t/gg/android-developers/121j6ypxkb/revoke-permissions-to-access-google-accounts

    Even uninstalling and re-installing the app doesn't help.

    This might be the way on a rooted device: How do you force AccountManager to show the "Access Request" screen after a user has already allowed access?

    0 讨论(0)
  • 2021-01-04 22:19

    I believe if you go to https://accounts.google.com/IssuedAuthSubTokens it should list your application under "Connected Sites, Apps and Services" from there you can revoke access.

    0 讨论(0)
  • 2021-01-04 22:21

    Using Google Play Services:

    http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html

    Add https://www.googleapis.com/auth/userinfo.profile to your scope.

    Example:

    String scope="oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
    
    final String token = GoogleAuthUtil.getToken(context, "xxxx@gmail.com", scope);
    

    OR "brute force"

    Intent res = new Intent();
    res.addCategory("account:xxxx@gmail.com");
    res.addCategory("scope:oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile");
    res.putExtra("service", "oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile");
    Bundle extra= new Bundle();
    extra.putString("androidPackageName","com.your.package");
    res.putExtra("callerExtras",extra);
    res.putExtra("androidPackageName","com.your.package");
    res.putExtra("authAccount","xxxx@gmail.com");
    
    String mPackage = "com.google.android.gms";
    String mClass = "com.google.android.gms.auth.TokenActivity";
    res.setComponent(new ComponentName(mPackage,mClass));
    startActivityForResult(res,100);
    

    Now, when you revoke the access here https://accounts.google.com/IssuedAuthSubTokens the application shows you the window for permission again in the device.

    0 讨论(0)
  • 2021-01-04 22:22

    Two steps to trigger the authorization page again:

    1. go to https://accounts.google.com/IssuedAuthSubTokens to revoke the app you want. This will clear the permissions from server side.
    2. go to your android device's settings->Data and time: fast-forward your time by a day or two. This will force the current token to expire.
    0 讨论(0)
提交回复
热议问题