Python: How can I create a GoogleCredentials using a specific user instead of get_application_default()
问题 I'm updating a script to call OAuth2-protected Google Cloud endpoints. The previous version assumed a single user previously authenticated by gcloud auth login and thus was able to use the default: credentials = GoogleCredentials.get_application_default() http = credentials.authorize(http) However now I must do some calls as user A and some as user B. I can perform these steps in the shell to generate access tokens, but I would prefer to do it in the program directly: gcloud auth login user_A