6

I have created a google service account.

My application was working fine before, I just had to change the service account from my personal to company wide.

I can see that my application does create credential file, means I'm getting all these values

("auth_provider_x509_cert_url",
    "auth_uri",
    "client_email",
    "client_id",
    "client_x509_cert_url",
    "private_key",
    "private_key_id",
    "project_id",
    "token_uri",
    "type",)

I'm getting all values but the error message says

site-packages/google/auth/crypt/_python_rsa.py", line 171, in from_string
    raise ValueError("No key could be detected.")
ValueError: No key could be detected.

I have also given the role as admin to this service account

Any idea where should I look at? because I have checked everywhere. It seems that that key is not valid but when I check my key, it is listed in service account in google console

bizimunda
  • 819
  • 2
  • 9
  • 26

1 Answers1

3

This happened to me when the private_key was invalid.

It needs to be the following format:

-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n
dain
  • 6,475
  • 1
  • 38
  • 47