Google Sign-In (OAuth)
In this lesson, we'll create the necessary OAuth credentials from the Google API Console that we'll need to use to set-up Google OAuth in our application.
📝 A sample of the
.envfile in our server project, after this lesson is complete, can be found - here.
Any application that uses Google OAuth to access Google APIs must have credentials that identify the application to Google's server.
To achieve this, we'll need to login to Google's API console:
When logged in, we'll create a new project by clicking the project drop-down menu and selecting NEW PROJECT.
We'll provide a project name of
TinyHouse and create the project.
With the project created, we'll be redirected to the dashboard of the created project. Next, we'll click Credentials on the left-hand pane which will take us the credentials page.
We'll click the Create credentials button available to us to create new credentials and we'll select the OAuth Client ID option. OAuth Client ID is the credential that can allow us to request user consent so our app can access user data.
We're told that to create an OAuth Client ID, we must set a product name on the consent screen.
We'll click the Configure consent screen button available to us to configure the consent screen we'll want to display to the user.
In the OAuth consent screen form, we'll state that the app, where the consent screen is being established, is to be public for any Google Account. We'll state the Application Name as TinyHouse and the support email will be the email address of the account connected to the developer console.
This page is a preview of TinyHouse: A Fullstack React Masterclass with TypeScript and GraphQL - Part Two