Set Up Project and Fetch Client Credentials

Learn to set up a project on the Google Cloud Platform and create authorization credentials.

Google OAuth 2.0 manages the OAuth 2.0 flow and token lifecycle that helps simplify the process of integrating Google APIs into applications. It allows resource owners to sign in to their Google accounts, provide consent, and share their information with the client in a secure manner.

This lesson goes over the steps needed to set up OAuth 2.0 with Google.

To get a better idea of the process, let's say you've built an application that fetches users' images and videos from Google Drive and allows the user to view or download these media files. The OAuth entities, in this case, are as follows:

  • Client: Your application that fetches media files.

  • Resource owner: The user who wants to use your application to fetch media files. You'll be accessing your own resources through the client, so you are the resource owner in this case.

  • Authorization server: Google's authorization server.

  • Resource server: Google's resource server.

To get started, you need to create a project on the Google Cloud Platform and generate your OAuth credentials. Let's go over the complete process to create a project and get the required credentials.

Create a project

  1. Head over to the Google Cloud Platform, and sign in using your Google account credentials. You may be presented with Google Cloud terms and conditions. If so, go through the terms and conditions, accept them, and click the "AGREE AND CONTINUE" button.

  2. You're redirected to the Google Cloud console home page. From the top menu bar, click "Select a project" next to the "Google Cloud" label.

  3. Click "NEW PROJECT" in the upper-right corner of the pop-up window. This redirects you to the project creation page.

  4. Enter the project name, and click the "CREATE" button.

  5. From the notifications menu to the right of the page, select the newly created project. This redirects you to the "Dashboard."

Note: If you want to use an existing project, you can skip the project creation stage and select an existing project from the pop-up window.

Get hands-on with 1200+ tech skills courses.