Skip to content

Using OAuthTokenGenerator

Chris Seeley edited this page Jan 16, 2024 · 5 revisions

Introduction

OAuthTokenGenerator is a Windows application that is distributed with Ads API .NET libraries. It allows you to generate a refresh token when you access API using your own credentials (installed application flow).

To get this application, download the latest binary distribution of the client library, and look within \lib folder of the zipped file.

Create an OAuth2 client ID

Follow the steps to generate a client ID and secret, then come back to this page.

Generate a refresh token

Start OAuthTokenGenerator.exe. You may need to run as an Administrator. The welcome screen is as follows:

Welcome screen

You need to provide the client id and secret you obtained from the above step. You also need to choose the APIs that your application plans to use. Tick all that apply. Now click OK.

Note: If you are working with Location Extensions in AdWords API and need to populate the OAuthInfo field of PlacesLocationFeedData, then select the 'AdWords API' Scope on this screen.

This will bring up a login screen. Login with your Google account credentials.

Login screen

Once you sign in, you will be presented with a Consent screen:

Consent screen

Click the Accept button to accept the request. OAuthTokenGenerator will complete the flow and present another screen with the necessary configuration.

Final configuration

You need to copy this configuration to your App’s App.config / Web.config.