0

I am trying to get account credentials for my Google account which can be stored in a command line file. The script expects these 3 parameters to be set.

local client_id = ""
local client_secret = ""
local refresh_token = ""

So I expect I need some kind of OAuth token which will never be invalidated.

Does anyone know how to acquire it?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
greg-e
  • 374
  • 4
  • 18

1 Answers1

0

You get the client id and the client secret from the Google dev console. You get the refresh token by doing a one-time authorization.

All of the steps are detailed in this answer How do I authorise an app (web or installed) without user intervention? (canonical ?)

Be very careful about how you secure the refresh token. It acts like a username/password for your Drive account, so could be used by "bad dudes". It's a good idea to use the most restrictive scope (step 8 in the above list). drive.file is a good choice if your script is uploading. If your script needs to download files, try drive.readonly.

Community
  • 1
  • 1
pinoyyid
  • 21,499
  • 14
  • 64
  • 115