Where To Revoke Google Api Permissions Granted On Android?
Solution 1:
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.
Solution 2:
Two steps to trigger the authorization page again:
- go to https://accounts.google.com/IssuedAuthSubTokens to revoke the app you want. This will clear the permissions from server side.
- 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.
Solution 3:
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?
Solution 4:
You need to programmatically revoke the token. First, try out the example app posted at: https://developers.google.com/drive/quickstart-android
This example app displays the dialog to let you pick an account, then takes a photo and then uploads it to Google Drive. One important thing I discovered is that this sample app will eventually fail. I discovered that the camera portion of the app causes crashes. So disable the camera part of the code and just replace the file with some file on an SD card and upload the file to Drive instead.
To revoke the permission to use Drive, you need to execute the following code:
Stringtoken= credential.getToken();
HttpRequestFactoryfactory= HTTP_TRANSPORT.createRequestFactory();
GoogleUrlurl=newGoogleUrl("https://accounts.google.com/o/oauth2/revoke?token=" + token);
HttpRequestrequest= factory.buildGetRequest(url);
HttpResponseresponse= request.execute();
Refer to the sample code on how to access the credential variable. Also, you must run the above code in a thread that is not on the main thread or it will fail.
You also need to add the following permissions. The sample code fails to indicate these permissions and without them the app will crash:
<uses-permissionandroid:name="android.permission.ACCOUNT_MANAGER" /><uses-permissionandroid:name="android.permission.GET_ACCOUNTS" /><uses-permissionandroid:name="android.permission.USE_CREDENTIALS" /><uses-permissionandroid:name="android.permission.MANAGE_ACCOUNTS" />
If Eclipse complains that some of those permissions are only granted to the system, just run Clean Project and it will remove the warning. After you have done this, you should uninstall the app and reboot the device. For more information about revoking tokens, see the section "Revoking a Token" at:
Solution 5:
After struggling to revoke authorisation for Gmail API permissions granted on my Android app (still in debug), I worked out that it does appear on https://security.google.com/settings/security/permissions like @David Waters mentions (it's a new link but goes to the same place) but only if you've properly enabled the API via the Google Developers Console. This means properly adding your OAuth 2.0 client ID, even if the app is still in development and in Debug Mode.
There's a very good guide on how to add your credentials on the Android Quickstart guide on the Gmail API site (Steps 1 & 2).
Post a Comment for "Where To Revoke Google Api Permissions Granted On Android?"