Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Set up Google OAuth

kesfc edited this page Feb 24, 2024 · 3 revisions

Step 1: Go to https://console.cloud.google.com/. Step 2: Greate a new project (if the project hasn't created on Google Cloud). Step 3: Search "OAuth" on the search bar on the top of the page, and select "OAuth consent Screen"

image

Step 4: Select "External" for "User Type" and click "CREATE" to go to the next page.

image

Step 5: Fill out the "App name" and "User support email" under "App information", and also fill "Developer contact information", then click "SAVE AND CONTINUE" to go to the next page.

image image

Step 6: Click "Add OR REMOVE SCOPE" and select needed scope. I only select the first two: User email and User profile. Press "SAVE AND CONTINUE" to go to the next page.

image image

Step 7: Click "ADD USERS" and enter the google account, which we want to use to test later, on the right side under "Add Users", then click "BACK TO DASHBOArD" to finish creating OAuth for this APP.

image image

Step 8: Before Creating "OAuth Client" we want first come back to our Project. Run "npx expo start --web --https" to open the app on computer and store the link. The link should be starting with "https://localhost/". This link will be used later.

Step 9: Come back on "Google Cloud"(where we just create OAuth). Click "Credential" on the left side. Click "CREATE CREDENTIAL" and then click "OAuth Client ID".

image image

Step 10: Chose "Web application" for "Application type", then click "ADD URI" under "Authorized JavaScript Origins", and enter link we got from the Step 8 here.

image

Step 11: Click "CREATE", "Client ID" and "Client Secret" will show on your screen, save it to wherever you want, and you should be able to use Google Login in the with your "Client ID" and "Client Secret".