How to store the access code of Google Drive locally and use for a long time? -


I am now using / using the Google Drive API to upload and file from my Google Drive.

For this purpose, I am using Google-provided CLIENT_ID and CLIENT_SECRET.

But the problem is that it runs every time I show my program will give me a URL, then I need to open URL to accept, then receive a code to continue the program. The code will end, so I have to do more of this work.

Is there no way to store this code locally, so can the program run without interacting with the user?

Thank you authorization_code and access_token to request Exchange

, the response will include it in the following format:
  {" ACCESS_TOKEN ":" 1 / fFAGRNJru1FTz70BzhT3Zg "," expires_in ": 3920 , "token_type": "carrier", "refresh_token": "1 / xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI"}  

ACCESS_TOKEN :, request with Google API To be used in one yes 'expires_in' seconds

Others while refresh_token you new valid ACCESS_TOKEN can refresh to get by using a Google tokens API refresh

Read more -> Using fresh token < / P>


Comments