Pregunta

I'm working on an integration with Google Calendar API. In order to get the authorization to access the calendar of the specific account, I use this snippet from the Calendar-Android-Sample Project:

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

For some reason, the sample project returns an "access-not-configured" error message, while mine works, and I've followed the same steps taken in the sample project, perhaps it is because that mine is another project.

The problem I'm facing is to repeat the authorization step of the API, since if I have authorized the access on a device, then even if I uninstall the application from that device, the next time I install it, it is authorized and I do not need to go through the authorization step again.

For the sake of consistency, I would like to be able to revoke the authorization given to the application so that the next time I would run any API call, I would have to authorize the application.

How can this be achieved?

Thanks, Adam.

¿Fue útil?

Solución

Duplicate question answered here:

Where to revoke Google API permissions granted on Android?

Doesn't appear to be a way of doing it programmaticly. But found out it appears you need to revoke third-party access (i.e. your program) from google.

Goto https://accounts.google.com/b/0/IssuedAuthSubTokens

Or

    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.

Now you should see that an application (hopefully named something you set to be your app name) using the calendar API, revoke this access and your good.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top