laura
laura

Reputation: 35

appNotInstalled when the refresh token is missing?

Lately I've been noticing a strange behavior when trying to access Drive specific actions. The use case is as follows:

If the user goes to Google Drive and opens a file from there using our application, they are redirected to a new authorization dialog that asks for the email, profile, drive scopes. After the user grants access, the initial export also works fine. My assumption is that the initial refresh token that we had was no longer valid, even though exchanging it for an access token worked and the refresh tokens don't expire.

Shouldn't we receive a more descriptive error message in this case that would suggest that we simply have to redirect the user to the authentication dialog instead of the Chrome Store listing?

Upvotes: 1

Views: 119

Answers (1)

Alain
Alain

Reputation: 6034

The issue might be that you are using a different client id/secret than the one you registered for the Drive SDK.

A quick test would be to:

  1. revoke all granted tokens for your application on your test account
  2. visit your application from the New Tab Page, it should redirect you to the authorization page: copy the URL you generated (do not approve).
  3. visit your application from Drive, it should redirect you to the authorization page: copy the URL (do not approve).

Make sure the 2 URLs are identical (they should be), especially look for similarities in the scope and client_id query parameters.

Upvotes: 1

Related Questions