Implement login with google in python flask applications with authlib

preview_player
Показать описание


In this video, we will learn we will learn how to implement login with google in flask applications.
Also we will fetch user’s personal information like age and gender from google after the user logs in

Please subscribe, like and share this video

00:00 - Intro
01:55 - OAuth 2.0 Authorization Code flow
03:32 - Authlib python module
04:19 - Register application in Google Cloud Console
10:53 - Creating flask application with google login
14:24 - login redirection endpoint in flask application
15:46 - login callback endpoint in flask application
16:38 - logging in the user with flask session
17:26 - Render user information in home page
20:58 - Access token to fetch gender and age from google people API
24:02 - User Logout implementation
24:52 - Render gender and birthday data
25:41 - Summary of flask application
26:05 - Outro

#google #oauth #authlib #sso #server #setup #python #web #dev #tutorial #learning #beginners #taming_python
Рекомендации по теме
Комментарии
Автор

great video, but i think the oauth2 login should be handled by FE side more than BE side (Flask)

futhedude
Автор

Hello sir, thank you for this tutorial! It was very helpful. May I ask for some additional help?

I followed your instructions, but I encountered an issue. When user clicks the login button, app was indeed redirected to "Google Sign in" page and then displays the scope options. The problem was in the `token = in `googleCallback` after the user was redirected, where I encountered invalid_grant: Bad Request` instead. May I ask for some guidance regarding this? Thanks!

syzygy
Автор

hello, amazing tutorial! I got this working with flask but I also have a frontend with React and I was wondering if you could help me out. When a perform an axios request to localhost:3000/google_login it keeps giving me a 302 error. I tried changing the url to localhost:5000/google_login but it still doesn't work. Also, my endpoint is google_login not google-login which redirect to an endpoint google_callback.

Boopdd
Автор

hey i am getting this type of message - "message": "Error Missing \"authorize_url\" value"

AkshadRathod-wr
Автор

will this work for a flask app that has several instances running a basic round robin load balance? so basically can the session and users data be used between separate servers ?

joshghazi
Автор

after logout I want to login with different email. What to do for that?

rishabhsingh
Автор

I want to login with another email but it doesn't work

rotimipraise
Автор

i keep getting a OAuth.register("myApp",
TypeError: OAuth.register() missing 1 required positional argument: 'name'

DavidAmodu-yz