How can i use a refresh_token generated using php-google-api-client on Gdrive installed in a server

8 views
Skip to first unread message

Alberto Valenty

unread,
Sep 27, 2018, 9:48:28 AM9/27/18
to Google Drive API and SDK
Hey guys!!! I'm building an web app using Google API client, PHP and Python as back-end, i'm getting the refresh_token from the client side using php, and then use shell_exec to run a python script that gets the refresh_token as a parameter and run Gdrive. The issue is, on PHP(api-client) the refresh token works fine but running on the Gdrive it shows this error:

401 Unauthorized
Response: {
  "error" : "unauthorized_client",
  "error_description" : "Unauthorized"
}

, notice that I'm using the same credentials and the correct scope (https://www.googleapis.com/auth/drive) , Does the Gdrive installed on a server ubuntu accepts only the refresh_tokens generated by it self?? can't i generate a refresh_token using php or javascript? the process of copy and paste the pin generated by the browser when running Gdrive doesn't help.

if anyone knows another way to skip this process (the process of copy and paste the pin generated by the browser when running Gdrive doesn't), please help


Reply all
Reply to author
Forward
0 new messages