How to get Google app Client ID and Client Secret

To work with Google APIs, you will need Google API Console project and Client Id. Which you can use to call different Google APIs. I wanted to integrate Google Sign-In into my website. The following blog post explains how to create Google API Console project, client ID and client Secret.

Though I used it for Google+ API, the same project can be used for other API access as well. You will just need to enable additional APIs (step 7 below).

  1. Login to Google Developer Console at https://console.developers.google.com using your google account credentials.
  2. If you are not registered on Google developer account, then you need to accept agreement.

  3. After accepting agreement or if you are already registered on Google developer account, you will see a screen as shown below. Click on “Select a project” on top header bar.

  4. From the project selection popup click on the button with plus icon to add new project.

  5. Enter your “Project name” and click on “Create” button.

  6. It will open list page of API and Services. (you can also open this page from left side menu bar > “Library” menu)

  7. From the list page search API with name “Google+ API” and click on the box with name “Google+ API”.

  8. It will show the detail page of “Google+ API”, click on “Enable” button and it will return you back to dashboard.

  9. From the dashboard click on “Credentials” from the left side menu.

  10. From “Credentials” page click on “OAuth consent screen” tab and enter your website URL. Then click on “Save” button.

  11. From the Credentials tab, click on “Create Credentials” dropdown and select “OAuth client ID”.

  12. On OAuth client id creation screen:
    • Select the “Web Application” radio button from the “Application Type”.
    • Enter your application name in “Name” field. This name will be shown to end users when they are asked to give login permission to your website. So please specify meaningful name which can identify your website.
    • Enter your catalog site URL in “Authorized JavaScript origins”. For example, if website domain is yourdomain.com, enter http://yourdomain.com
    • In “Authorized redirect URIs” input box, enter your website URL + the page/end-point where you wanted your user redirected back. If you are using Microsoft.Owin.Security.Google library, the end-point is “/signin-google”. For example, my website url is http://yourdomain.com, so I enter http://yourdomain.com/signin-google
    • Click on “Create” Button.

  13. It will display the popup with client id and client secret.

Add comment

Loading