oauth 2.0 – error to use https://www.googleapis.com/auth/drive scope

oauth 2.0 – error to use https://www.googleapis.com/auth/drive scope

You are missing an h in the protocol. Try https://docs.google.com/feeds/ instead of ttps://docs.google.com/feeds/. Apply the same change to all your scope urls

From the Google documentation about Using OAuth 2.0 for Devices (https://developers.google.com/identity/protocols/OAuth2ForDevices#allowedscopes):

When you use the OAuth 2.0 flow for devices, you can access only the following scopes:

  • Analytics Configuration and Reporting APIs
  • Calendar API
  • Contacts API
  • Cloud Print API
  • Cloud Storage API
  • Fitness REST API
  • Fusion Tables API
  • Google Sign-In
  • YouTube Data and Live Streaming APIs

I dont see Drive API in this list and I think its a reason of invalid_scope error

oauth 2.0 – error to use https://www.googleapis.com/auth/drive scope

I have exactly the same problem with.
Ive followed the instructions in the developing document, and use www.googleapis.com/auth/drive as my the scope in the request.
Eventually, I got invalid_scope in the response.

So Ive try to use www.googleapis.com/auth/devstorage.full_control as the scope, and it worked!The hint is from :https://cloud.google.com/storage/docs/authentication#oauth

BUT!! When I use the access token I created to list the google drive account information, I got error code 403 and the message is Insufficient Permission.

This is what I used to request the account infornation:
curl -H Authorization: Bearer $ACCESS_TOKEN https://www.googleapis.com/drive/v2/about?key=$APP_KEY

That really made me confused….

Leave a Reply

Your email address will not be published. Required fields are marked *