I am trying to create a Chrome Extension which would save some data to the user's Google Drive. I figured OAuth
would be the best way to go about it. So I do the following in manifest.json
:
"oauth2": {
"client_id": "<my_client_id>",
"scopes": ["https://www.googleapis.com/auth/drive"]
}
After that, I want to use the Google API for authentication in my background.js
using gapi.auth.authorize
etc. However even if I include https://apis.google.com/js/client.js
in background scripts of manifest, it still can not find it. What am I doing wrong? Is there a better way to use OAuth?