How can I get rid of 403 "org_internal: This client is restricted to users within its organization" when trying to generate a refresh token?
When I use the generate_refresh_token.py
:
pipenv run python authentication/generate_refresh_token.py --client_id xxxxx --client_secret yyyy Log into the Google Account you use to access your AdWords account and go to the following URL: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=xxxx&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&state=xxxxx&prompt=consent&access_type=offline
When I follow the link I get a 403 "org_internal: This client is restricted to users within its organization", I'm using a google account that has the name.surname@domain.com that matches the organization's domain and I have been invited to the project.
What else is need for my google account to be considered part of the "organization"?
The google account that you are using is probably a "consumer account" even if it has the same @domain.com as the organization that you are trying to use.
You need your IT admin to migrate the consumer account to the organization's Google Cloud account following the process described here.
You will receive an email titled "Google account transfer request" prompting to authorize the transfer: