user to impersonate get authemtication errors on google my business api
Using V.2.0.0 RC6
If I include $user_to_impersonate = '[email protected]'; $client->setSubject($user_to_impersonate);
I can not access the api and get this exceptiion { "error": "unauthorized_client", "error_description": "Unauthorized client or scope in request." } It was working fine until yesterday 9-march around 4 pm pst. If I access without the sub, I can not see my account listings.
Is there a workaround for this?
Getting the same error with version 1.1.6 and
$scopes = ['https://www.googleapis.com/auth/analytics.readonly'];
Good to know it's not a version issue at least.
Seems maybe Google updated their API to disallow top level accounts being impersonated, but I haven't seen that documented anywhere online yet.
My Stack Overflow about it here: http://stackoverflow.com/questions/35923375/impersonated-user-unauthorized-in-google-analytics-api-using-service-account
Authorization still works without the $user_to_impersonate, but I need to impersonate our main company account in order to access all our GA accounts.
Google probably changed the handling of service accounts and this doesn't work anymore.
This was not an issues with the api. but with the google api. Which has been resolved.
@jmckay56 Thanks dude!
Hi I am using Using V.2.0.0 RC6 connecting to the Google My Business API $user_to_impersonate = '[email protected]'; $scopes = ['array_of_scopes'];
$client = new \Google_Client();
$client->setSubject($user_to_impersonate);
$client->setAuthConfig('/path/to/service-account.json');
$client->setScopes($scopes);
This is working for me.
@JustinBeckwith this is already closed. What action are you expecting me to take?