Login / Signup / SignIn with Google GSI | OAuth2.0

Опубликовано: 18 Март 2026
на канале: Consulting Ninja
4,873
96

In this video I show how to setup your Google Developer Console to create an OAuth 2.0 consent screen and OAuth2 client id credentials to allow signing in with Google. I then show where to get the official google-auth-library for creating the initializing url and verifying tokens and extracting credentials. After that I show how to setup a SvelteKit form action to start the request and a SvelteKit GET end point to process the request back from Google! I hope that you find this helpful!

My channel membership is live check it out here!:
   / @consultingninja  

Membership perk video:
   • I launched a chatbot with my channel membe...  

You can also now support me here!:
https://account.venmo.com/u/consultin...

API Source Code here:
https://github.com/consultingninja/gs...

Front-end (html file) Source Code here:
https://github.com/consultingninja/gs...

Code Generator here:
https://developers.google.com/identit...

Google GSI Docs here:
https://developers.google.com/identit...

OAuth2Client docs here:
https://cloud.google.com/nodejs/docs/...

Need help? visit https://www.consultingninja.tech
Check out my channel @ConsultingNinja for more videos like these.

Requirements when using Google Sign in Docs:
https://developers.google.com/identit...

00:00 - Intro
00:56 - GSI Overview
02:16 - Setup
03:20 - Code Generator
04:44 - Api getKeys info
05:22 - Code Generator Options
07:43 - In-correct Documentation
08:35 - Example
09:34 - Api portion
12:31 - CSRF Route Info
14:55 - What Next?
15:33 - Wrap up
15:47 - Google Console Setup (client id)

post release update Googles Documentation is not great and you should play around a bit with opening different pieces of this to see what is inside. As an example: One place in Googles docs said that the field "id_token" only had 4 properties and none of them very useful. However after opening with const ticket = await oAuth2Client.verifyIdToken({idToken: id_token,audience:process.env.CLIENT_ID,}); I found this contained all user information as well. I have found other instances of Googles docs being misleading and or inaccurate. Just a note!