A guide on how to add YouTube Data API v3 to a Google Cloud Platform project and generate OAuth credentials to use in WordPress plugin YouTubeHub.
1.1 Begin by visiting https://console.cloud.google.com.
1.2 After clicking “Select a project“, into the modal window click on “NEW PROJECT” to begin creating your new project.
1.3 Choose a name for your project and click “Create”.
1.4 Wait until the project is created (will take a few seconds) and when done open the newly created project by clicking in “Notifications” area.
2.1 After opening the project, scroll down in project Dashboard until you see the “Getting Started” panel. In it, click “Explore and enable APIs“.
2.2 In API explore screen, click on “ENABLE APIS AND SERVICES“.
2.3 Insert into the search field “YouTube data API“.
2.4 Click on “YouTube Data API v3” in search results.
2.5 In API screen, click “Enable” to enable this API for your project.
3.1 In left-side menu of your API click on “Credentials“.
3.2 Click “CREATE CREDENTIALS” and into the menu that opens click on “OAuth client ID“.
3.3 In screen for creating OAuth client ID you will notice that everything is frozen and you are required to configure consent screen. Click on “Configure consent screen“.
3.4 In Consent screen configuration enter a name for your application in field “Application name” and save the settings.
3.5 After creating the consent screen click on “Credentials” in left menu and click “Create credentials” in page. This will open a menu, choose “OAuth client ID“.
3.6 Go to your website and copy the return URL for OAuth. The return URL should be the address to your WP admin screen (ie. https://my-website.com/wp-admin).
3.7 Paste the return URL in field “Authorized redirect URIs” in OAuth client ID screen. You will notice and error that asks you to add the domain to the authorized domain list. Click the link for the authorized domain link.
3.8 This will take you back to the consent screen settings. In field “Authorized domains” add the domain name from your return URL (ie. my0website.com) and save the settings.
3.9 Do step 3.5 again to open the OAuth client ID screen. In field “Authorized redirect URIs” enter the URL you got from your website on step 3.6 and save the settings.
3.10 Copy the client ID and client secret and paste them in your website into fields “Client ID” and “Client secret” in plugin Settings page, tab “API & License”.