Closed 9mm closed 6 years ago
Damn I've seriously looked through 100 threads related to this and finally found one that was helpful. The step I was missing was adding the client_id
from the JSON key to the 'authorized client' list in admin.google.com, and also the oauth2_prn
user to impersonate.
Now I have a new error though... AuthorizationError.USER_PERMISSION_DENIED
. Am I supposed to use the global MCC account rather than my test MCC? (My dev token isnt approved yet). If I use my master MCC email for oauth2_prn
I get the above error, but if I use my test MCC I made I get this error: Client is unauthorized to retrieve access tokens using this method.
Here is how I have it set up again:
oauth2_key
, oauth2_issuer
)https://www.googleapis.com/auth/adwords
)developer_token
)oauth2_prn
)client_customer_id
)They key takeaway is all this was under the production account. The only test stuff I created was MCC/client account (I didnt create a test google developer console service or API access or anything like that)
It's very strongly recommended that you use the installed app flow rather than service accounts to access the AdWords API. Please take a look at our Authentication docs which include instructions for both. Especially check out the section explaining why to prefer installed flow over service accounts.
That said, this issue doesn't look specific to the ruby library, which is what issues here are for. You'll get better support for these authentication issues on our official forum.
Ok thanks
I've followed the directions best I could and when I run the following test command I get this error:
Here is how I'm authenticating (JSON key parsed via
OpenSSL::PKey::RSA
):Here are the steps I did in order:
oauth2_issuer
developer_token
).I'm not sure where I went wrong, from what I can tell I followed the steps exactly.
Thanks