Using OAuth 2.0 for Server to Server Applications | Google Identity | Google Developers
Important: If you are working with Google Cloud Platform, unless you plan to build your own client library, use service accounts and a Cloud Client Library instead of performing authorization explicitly as described in this document. For more information, see Authentication Overview in the Google Cloud Platform documentation.
https://developers.google.com/identity/protocols/oauth2/service-account#python_1