In this article I will explain step by step, how to get Google API Key (Client ID) and API Secret (Client Secret) from Google Developer Console.
In order to access Google APIs using OAUTH, we need to create a Project in Google Developer Console and generate the Google API Key (Client ID) and API Secret (Client Secret).
The generated API Key and API Secret will then be used for making OAUTH calls to the Google APIs.
 
 
Creating Project and Google API Client ID and Client Secret
In order to create Google API Client ID and Client Secret follow the below steps.
First you need to visit Google Developer Console using the following URL and Login with your Google account.
 
Submitting Personal and Payment Information
The very first process is to submit personal and payment information as the Google API Services are chargeable after the threshold limit.
Note: Without a Credit or Debit Card, you won’t be available to create Google API.
1. In the first step, select the Country and click on AGREE & CONTINUE.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
2. In the next step, select Account type and fill the Payment method details and click on START FREE button.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
3. Enter the CVV of your Credit or Debit card, and click on Continue button.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
4. Then, again click on Continue button.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
5. Next, enter the OTP received on your registered mobile number and click on SUBMIT.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
6. Finally, once the payment is successful, you will now see the following screen where you can create an API.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
 
Creating a API New Project
This process allows you to create a Google API project, you will need to follow the following steps.
1. In the Enabled APIs and services tab, click on CREATE PROJECT link.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
 
2. Then, in the next step you will need to enter Project details such as the Project name TextBox and click on CREATE.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
 
Enabling the APIs and the services
The following process is used to enable APIs in the project.
1. Let’s add API to the project by clicking the API library link as shown below.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
2. Then, in the API library window, look for Google People API from the list and click on it.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
3. Next in the Product details window, you need to click on ENABLE button.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
4. The API is enabled now and you can proceed to create the Client ID and Client Secret.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
 
Creating API Client ID and Client Secret
1. Now in the API/Service details window, click on CREATE CREDENTIALS button.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
2. Then, in the Create credentials window, choose the API as People API and the User data RadioButton as Credential Type and click on NEXT.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
3. In the next step, you can add scopes by clicking on ADD OR REMOVE SCOPES and click on SAVE AND CONTINUE button.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
4. Next in the OAuth Client ID step, select Application type from autocomplete TextBox. Here it is Web application.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
5. Then, specify a name to the OAuth2.0 client.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
6. Next, you need to specify the Authorised redirect URIs of the application where the user will be redirected after successful authorization and click on CREATE.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
7. Finally, the Client ID is successfully generated. Now, you have option to copy the Client ID or download the Client ID and Client Secret in JSON format.
Google Developer Console: Generate Client ID and Client Secret for use with Google APIs
 
Following is the downloaded JSON string which contains the Client ID and Client Secret along with other details.
{
 "web": {
    "client_id": "<Client_ID>",
    "project_id": "<Project_ID>",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_secret": "<Client_Secret>",
    "redirect_uris": [
      "http://localhost:55989/CS.aspx","http://localhost:55989/"
    ]
 }
}