Google Adwords Oauth playground “error”: “unauthorized_client”

428 views
Skip to first unread message

suresh babu

unread,
Apr 16, 2018, 7:12:37 AM4/16/18
to AdWords API Forum

My Company has an Ad-word Account. I want to generate a refresh token to access the API. To generate refresh token I did the following:

I created a developer account and did the following in my account

Get a client ID and client secret

  1. Open the Google API Console Credentials page.
  2. From the project drop-down, select an existing project or create a new one. On the Credentials page, select Create credentials, then select OAuth client ID.
  3. Under Application type, choose Web application.
  4. Under Authorized redirect URIs, add a line with: https://developers.google.com/oauthplayground Click Create.
  5. On the page that appears, take note of the client ID and client secret. You'll need these in the next step.

Then 

  1. In the OAuth playground, I used the above clientId and clentSecret and clicked authorize and it was asking for a login.

  2. I sent the link to my manager to login to the company ad-word account and authorize it and send me the returned URL which is the playground URL for generating refresh token.

  3. After receiving the URL, I cliked on generate refresh token and it responded with "error": "unauthorized_client"

Is there something wrong with the above steps? 

My developer account should be linked or added to my company account before I can do above steps?

Do I need any developer token?

Kind help appreciated.

Teja Makani

unread,
Apr 16, 2018, 2:58:28 PM4/16/18
to AdWords API Forum
Hello Suresh,

The steps until point 1 in the OAuth playground seems to be correct. Please check the next steps below:

1. Send the link to your manager to login to the company's AdWords account and get authorization code from your manager account. Once you have the authorization code, you will need to continue the same screen flow until generating the Authorization code in the OAuth playground and replace your authorization code with the manager's authorization code. Then please proceed to the step 8 from this setup guide to generate refresh token and access token. You can use this refresh token to make a API calls against your manager account. Please note that you will need to use the authorization code generated by the manager. Also, request the manager not to generate the refresh token for the authorization code that is being passed to you since an authorization code can only be redeemed once. If Manager passed on the refresh token instead of authorization code for you to use that directly, it will fail as the refresh token belongs to a different client credentials. 

Could you please follow the steps and retry? Let me know if you are still facing issues.

Regards,
Sai Teja. AdWords API Team.
Reply all
Reply to author
Forward
0 new messages