API access using own credentials (server to server flow) - jimper/googleads-dotnet-lib GitHub Wiki

This guide will walk you through how to setup OAuth2 for API access using your own credentials using server to server flow. These steps only need to be done once, unless you revoke or delete your OAuth2 credentials.

Step 1 - Creating OAuth2 credentials

Follow the steps for the product you're using to generate a *service account ID and a .p12 file, then come back to this page.

If you're an AdWords user, please note that this flow requires a Google Apps Domain.

Step 2 - Setting up the client library

Configure the following keys in your App.config / Web.config.

<add key="OAuth2Mode" value="SERVICE_ACCOUNT" />
<add key="OAuth2ServiceAccountEmail" value="INSERT_OAUTH2_SERVICE_ACCOUNT_EMAIL_HERE" />
<add key="OAuth2PrnEmail" value="INSERT_OAUTH2_USER_EMAIL_HERE" />
<add key="OAuth2JwtCertificatePath" value="INSERT_OAUTH2_JWT_CERTIFICATE_PATH_HERE" />
<add key="OAuth2JwtCertificatePassword" value="INSERT_OAUTH2_JWT_CERTIFICATE_PASSWORD_HERE" />

Note that the default certificate password is notasecret. No additional code is required to configure AdsUser in this case.