I'm a novice user, so its quite likely the problem is at my end -- so with that warning, here goes.
I have a simple drive search program with OAuth2, and it keeps failing with insufficient authentication scopes. I have pretty much all the authentication scopes selected, but it seems fail regardless...Is passing in the SCOPES array being done correctly?
Any help is appreciated!
Solved! Go to Solution.
I found out the issue here. There are a couple of issues:
1. The golang example expects a code to be printed on the browser, but for some reason unlike the python example, it does not spin up a webserver to show the code. So, one should extract the code from the url generated and paste that in. It works fine later
2. The issue in my code was indeed to do with the scopes being passed in. There was a flaw in my understanding though, the scopes are passed in at first via the js code and then the golang handler was kicking in to make the request with the token (that also specifies scopes). So, while the scopes defined in the golang code was correct, the js code was not specifying the scopes correctly. I am using a clientid and not a service acct.
Moral of the story is understand oauth2 carefully, it's a 3 legged stool and can fail at any leg.
Posting it here in case this is useful to someone else in the future.