Cmdlets for YouTube Analytics

Build 24.0.9060

Creating a Custom OAuth Application

Setting up OAuth authentication requires some advance configuration. Once the user account, service account, or GCP Instance account is configured correctly, it is ready to connect.

User Accounts

This section describes how to register a custom OAuth application and obtain the OAuthClientId and OAuthClientSecret for User Accounts.

Desktop

To register an app and obtain the OAuth client credentials:

  1. Log into the Google API Console.
  2. Open a project.
  3. From the main menu, select the API Manager.
  4. In the user consent flow, click Credentials > Create Credentials > OAuth Client Id.
  5. Click Other. The Google API Console creates the custom application and displays the OAuthClientId and OAuthClientSecret.
  6. Record the OAuthClientId and OAuthClientSecret for later use.
  7. Click Library > YouTube Analytics API > Enable API.

Headless Machines

To register an app and obtain the OAuth client credentials:

  1. Log into the Google API Console.
  2. Open a project.
  3. From the main menu, select the API Manager.
  4. In the user consent flow, click Credentials > Create Credentials > OAuth Client Id.
  5. From the dropdown, select "Desktop app". Give the application a name, then click Create. The Google API Console creates the custom application and displays the OAuthClientId and OAuthClientSecret.
  6. Record the OAuthClientId and OAuthClientSecret for later use.
  7. Click Library > YouTube Analytics API > Enable API.

Service Accounts

To create an OAuth application, generate a private key, and then authorize the service account:

  1. Log into the Google API Console.
  2. Open a project.
  3. From the main menu, select the API Manager.
  4. In the user consent flow, click Credentials > Create Credentials > Service Account Key.
  5. In the Service Account menu, select either New Service Account (if applicable) or an existing service account.
  6. If this is a new service account, select one or more roles. You can assign primitive roles at the project level in the IAM and Admin section; other roles enable you to further customize access to Google APIs.
  7. In the Key Type section, select P12.
  8. Click Create. The Google API Console creates the custom application and displays the key pair and the password for the private key.
  9. Download the key pair and set the private key's password in OAuthJWTCertPassword.
  10. In the Service Account menu, click Manage Service Accounts.
  11. Set OAuthJWTIssuer to the email address displayed in the service account Id field.
  12. Click Library > YouTube Analytics API > Enable API.

GCP Instance Accounts

When running on a GCP virtual machine, the cmdlet can authenticate using a service account tied to the virtual machine. To use this mode, set AuthScheme to GCPInstanceAccount.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060