2

I followed the public tutorial here for creating a chrome extension calling Google Identity api to get the Oauth2 token. It is not working. In the Chrome extension loaded into the browser in developer mode, when I click the button in the home page for the extension, it just gets an error

Unchecked runtime.lastError while running identity.getAuthToken: OAuth2 request failed: Service responded with error: 'bad request' at HTMLButtonElement. (chrome-extension://dgpoakddenlpjocgikkadcklmpfmadlh/oauth.js:3:23)

This is most annoying and unhelpful. Any help is much appreciated.

Walking Corpse
  • 107
  • 7
  • 31
  • 49

1 Answers1

0

I think the problem is that in the first part of the tutorial the scopes array is empty.
you can add some scopes, for example "profile" and "email" and reload the extension.
copy the access token from the console and check it in: https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=PASTE_ACCESS_TOKEN

Assaf
  • 1
  • 1