Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

authorizing a google api client without a browser?

I have a python cron job which performs operations on my calendars which I run on my laptop.

I currently am using a "Client ID for native application" for the python script.

Authorizing the client_secrets.json credential is not a problem on a desktop or laptop since I have a full GUI browser which runs javascript. However, the client_secrets.json file which works on my laptop doesn't seem to work if I move it to another server.

I'd like to move the python cron job to a cloud server. My questions are:

  1. Should a client_secrets.json file which has been authorized on one machine work on another server?
  2. Authorizing a client_secrets.json credential without a GUI browser (or one that doesn't run javascript) is a problem. Can the authorization be scripted (since I have the Google user name and password)?
  3. Should I be using a different authorization method other than a "client id for native application"?
like image 512
ErikR Avatar asked Nov 24 '25 07:11

ErikR


1 Answers

You may need to setup a service account.

It allows you to access google api's from another server without the need for the oAuth middle man.

Read up here: https://developers.google.com/accounts/docs/OAuth2ServiceAccount

like image 86
Eric Uldall Avatar answered Nov 26 '25 15:11

Eric Uldall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!