We are trying to use google.picker
to have our users upload files to our drive account (i.e., the user is not required to have a Google account to upload).
We're trying to use regular Google accounts as application-owned accounts and got our AUTH_TOKEN
using OAuth2 and set it using .setOAuthToken(AUTH_TOKEN)
. We followed everything described in the docs.
However, when uploading, we got a Server Rejected
error. The call to https://docs.google.com/upload/resumableupload?authuser=undefined
returned:
{"errorMessage":{"reason":"REQUEST_REJECTED","additionalInfo":{"uploader_service.GoogleRupioAdditionalInfo":{"completionInfo":{"status":"REJECTED"},"requestRejectedInfo":{"reasonDescription":"agent_rejected"}}},"upload_id":"AEnB2Ur64Gb0JDCk_8mg5EhpdcaqL82wBQHumHjcGvDqYibtksmUzhfhBolsmBFzRuvQPRyi43SYfactJZvIWYrQ6xAqzu3L9g"}}
We know we cannot use service accounts since the picker doesn't support it.
Do we miss something in getting the AUTH_TOKEN
? Do we need to something in the console?
Unless the servers are to be blamed, more often than not, the server rejected error in Google Classroom is caused due to insufficient free storage in Google Drive. It can also be caused if your phone isn't connected to the WiFi and the Transfer files only over Wi-Fi setting is disabled.
Check the call to gapi.auth.authorize()
window.gapi.auth.authorize( { 'client_id': clientId, 'scope': scope, 'immediate': false }, handleAuthResult);
from: https://developers.google.com/picker/docs/#hiworld
Without an actual code sample, it is very difficult to say exactly what is going on. Most likely it is the auth token colection. However, it may also be something as simple as not defining a google User (clientID) which in turn impacts the gapi.auth.authorize()
call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With