We have a Google Drive Oauth2 App integration. We are using Google Drive API export and get endpoints in order to read data from our customers within their Google Drive Fold
We managed to make it work again. We've found this: https://cloud.google.com/blog/products/application-development/upcoming-changes-to-the-google-drive-api-and-google-picker-api
Google didn't update their Drive API document, so we didn't know about this change.
Basically we have to switch from the access_token URL parameter to the Authorization Header. This is, to authenticate the API you should use the Header like this:
"Authorization" : "Bearer ACCESS_TOKEN"
This worked for us.
Thank you everyone for the help.
We're having the same problem and after some testing, we've found Google appears to be checking more thoroughly the origin of the tokens.
According to https://developers.google.com/drive/api/v3/about-auth
- If the user approves, then Google gives your application a short-lived access token.
- Your application requests user data, attaching the access token to the request.
- If Google determines that your request and the token are valid, it returns the requested data.
We're using a JS file picker and after receiving the object data, when we attempted to $.get
it, the file was downloaded correctly but that same URL anywhere else was returning an error.
UPDATE
We got it working again with https://developers.google.com/drive/api/v3/manage-downloads:
To download a file stored on Google Drive, use the files.get method with the ID of the file to download and the
alt=media
URL parameter. Thealt=media
URL parameter tells the server that a download of content is being requested.