Hi, I´m trying to authetica in Google Adwords API but I recive an error:

"oauth2client.client.AccessTokenRefreshError: access_denied: Requested 
client not authorized."

This is my code:


p12_file = os.getcwd() + '**************.pem'
service_account_email = '*********@developer.gserviceaccount.com'
impersonation_user_email = '******@*****.es'
with open(p12_file, "rb") as f:
    private_key = f.read()

self.auth_adwords = 
oauth2.GoogleServiceAccountClient(oauth2.GetAPIScope('adwords'), 
service_account_email, p12_file, sub=impersonation_user_email)



The error is in the last line. I need to change the .p12 key because if I use 
.p12 raise an error about the key and I read about the problems is PyCripto 
(the library used by googleads) have a problem with p12 keys.

I created the project in console.developer.google.com, and create a service 
account. I go to my Google for work panel and autorize de client id with the 
google adwords scope and the impersonation_user_mail have permissions for the 
entire MCC.

Someone can help me?

Thanks a lot!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d8245638-b287-4920-99b4-ce95b2690e30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to