googleads-python-lib icon indicating copy to clipboard operation
googleads-python-lib copied to clipboard

Enable constructing GoogleServiceAccountClient with Credentials.from_service_account_info method

Open attilatoth86 opened this issue 1 year ago • 1 comments

When initializing a GoogleServiceAccountClient, it expects Service Account JSON key file but there is no way to pass in the key file content as dictionary (e.g. after reading out from a secret store) because the constructor is limited to use the google.oauth2.service_account.Credentials.from_service_account_file()class method. Can this constructor be extended with .from_service_account_info() method, too?

https://google-auth.readthedocs.io/en/master/reference/google.oauth2.service_account.html#google.oauth2.service_account.Credentials.from_service_account_info

attilatoth86 avatar Oct 03 '23 15:10 attilatoth86

Thanks for the suggestion! In the meantime, you can use any google.oauth2 Credentials object with this library https://github.com/googleads/googleads-python-lib/blob/main/googleads/oauth2.py#L215

christopherseeley avatar Mar 25 '24 17:03 christopherseeley