JohnyMotorhead
JohnyMotorhead

Reputation: 821

Revoke Google application callback endpoint

We're implementing web application and using Gmail API C# SDK to provide the access to users' mail.

We revoke access to our app like following:

IAuthorizationCodeFlow googleApp;

var token = await googleApp.LoadTokenAsync(orgId, CancellationToken.None).ConfigureAwait(false);

googleApp.RevokeTokenAsync(orgId, token.AccessToken, CancellationToken.None).ConfigureAwait(false);

Code above works good - it removes the token from data storage and also it removes our app from Google Third Pary Apps with access to user's account.

But what if user wants to revoke the app not withing our application, but from his Google account itself - how can our application get know that ? Is there any callback url that we can configure on our side to catch and handle the call from Google in this case? We didn't find anything similar neither in documentation nor in https://console.developers.google.com/.

Of course, we know that we can handle it in our code when we make calls to Google and catch the specific Google SDK TokenResponseException exception, however it would be usefeull to have the callback endpoit.

Thanks, Evgeny.

Upvotes: 1

Views: 855

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117226

But what if user wants to revoke the app not withing our application, but from his Google account itself - how can our application get know that ?

Google will not inform you that your access was revoked with in their system.

The next time your application runs and attempts to use its refresh token its going to get an error message stating that you dont have access. You will need to handle this error message and request access again.

If you are using the google .net client library then you shouldn't worry it will handle the error by showing the user the consent screen again

Upvotes: 1

Related Questions