I am trying to authenticate a Google Admin SDK using ServiceAccountCredentials.from_json()
. I am using the Google Cloud Platform to run a Cloud Function. The Cloud Function gets a file from Cloud Storage, decrypts it, then uses that file to authenticate the service. According to this I can authenticate using from_json_keyfile_name
. I wont have a direct path though so I attempted to authenticate with the contents of the file from Google Console -> API -> Download credentials
. That json has the following keys:
- type
- project_id
- private_key_id
- private_key
- client_email
- client_id
- auth_uri
- token_uri
- auth_provider_x509_cert_url
- client_x509_cert_url
However, ServiceAccountCredentials.from_json()
looks for _private_key_pkcs12
. which is not in the downloaded json.
ServiceAccountCredentials.from_json()
but it excepts data like_private_key_pkcs12
which is not found in the json file downloaded from Google Console. – user1222324562