FastAPI + Github OAuth

  Рет қаралды 6,965

Will Estes

Will Estes

Жыл бұрын

Quick tutorial of using the Github OAuth app flow with FastAPI.

Пікірлер: 35
@mytj228
@mytj228 9 ай бұрын
Very good tutorial, thanks!!!
@mj2068
@mj2068 11 ай бұрын
thx this is so cool and your instructions are clear keep up
@felixreynoso3746
@felixreynoso3746 Жыл бұрын
awesome tutorial man
@cusematt23
@cusematt23 7 ай бұрын
Great video!
@user-ye6jj9yf8g
@user-ye6jj9yf8g 10 ай бұрын
Extremely helpful! Thanks a lot!
@gabrielmorelli2534
@gabrielmorelli2534 Жыл бұрын
Thanks dude, your video help me a lot
@EstesAdvTech
@EstesAdvTech Жыл бұрын
Appreciate it! Let me know if there’s other content you’d be interested in 👍
@mathis7117
@mathis7117 8 ай бұрын
thank you it's perfect
@streamocu2929
@streamocu2929 9 ай бұрын
thank you ❤
@romanmikhailov5932
@romanmikhailov5932 21 күн бұрын
great tutorial. if you could post the code in git or gist, would make it even better!
@EstesAdvTech
@EstesAdvTech 21 күн бұрын
@@romanmikhailov5932 thanks! That is my one regret about this video, didn’t save the code 😞😞
@science_horizonts
@science_horizonts 9 ай бұрын
Thank you very much, very informative Can you please make a video what to do when there are several oauth providers on the site how to create a database and store users?
@EstesAdvTech
@EstesAdvTech 9 ай бұрын
Multiple OAuth providers and a DB? Got it. I’ll try to get something out for you 👍
@nischalsehrawat2130
@nischalsehrawat2130 8 ай бұрын
Hi Will. Thanks for the mazing video. I was wondering how do you go about implementing integration testing with Oauth ?
@EstesAdvTech
@EstesAdvTech 8 ай бұрын
Integration testing with OAuth gets a little hairy, so it really depends on what kind of testing you'd like to do. Offhand, there's a few options available (not in any particular order, I'll add more if I think of any) 1. Create a mock token for the OAuth provider and use a mock server to replicate the functionality 2. Create test user(s) for use in your tests so "real" interactions can occur 3. Create an application token through the oauth provider (like oauth-playground in Googles GCP. I've never used these but they might be promising) I've seen numbers 1 & 2 in practice. I think the question you need to answer is "Am I testing the OAuth provider as well as my code?" - If you answer no (most cases), then a mock token/server is likely a good option. If yes, creating a test user(s) might be the way to go. Hope this helps! Thanks for watching!
@nischalsehrawat2130
@nischalsehrawat2130 8 ай бұрын
@@EstesAdvTech Thanks for the answer. Another question. Does Github support OIDC. Because I don't get any refresh token back nor an ID token. Any ideas ?
@EstesAdvTech
@EstesAdvTech 7 ай бұрын
​@@nischalsehrawat2130 I was able to find this: docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28 Hope this helps!
@a.s8840
@a.s8840 Жыл бұрын
Can you please tell me how to do same with Google
@yiouyou
@yiouyou 4 ай бұрын
Failed to follow the example code, how the app know it should go to github-code after clicking the authorization button of github-login?
@EstesAdvTech
@EstesAdvTech 3 ай бұрын
Hi - Are you referring to timestamp 4:08 where I create the OAuth app? There are 2 URLs to enter, the homepage and callback. The callback is what tells it to go the the /github-code URL in my application after authorization
@alikemalagrman1067
@alikemalagrman1067 Жыл бұрын
Thank you so much, if multiple github users use this app, does github send different tokens, or everytime the same token.
@EstesAdvTech
@EstesAdvTech Жыл бұрын
It’ll be a different token for each user.
@alikemalagrman1067
@alikemalagrman1067 Жыл бұрын
@@EstesAdvTech How can we refresh token without prompting to user? Can you also make a video about how security schemes work?
@EstesAdvTech
@EstesAdvTech Жыл бұрын
@@alikemalagrman1067 You can use a refresh_token. See docs here: docs.github.com/en/developers/apps/building-github-apps/refreshing-user-to-server-access-tokens I'll see what I can do about making another long-length video for you. Is there anything specific you'd want to see?
@ParacelsusCaspari
@ParacelsusCaspari 5 ай бұрын
what if i get a CORS error? i can't even trigger the redirect
@EstesAdvTech
@EstesAdvTech 5 ай бұрын
did you double both your urls in github? I didnt setup any configurations for CORS so my guess is it's specific to your environment?
@ParacelsusCaspari
@ParacelsusCaspari 5 ай бұрын
i’m trying with gitlab and oauth2 but otherwise the processes are similar i’ve set up the cors middleware to allow all origins but when i try it manually i’m told that the callback url on gitlab’s side isn’t valid
@EstesAdvTech
@EstesAdvTech 5 ай бұрын
@@ParacelsusCaspari Can you set the middleware to allow all origins? Does something like this help: github.com/tiangolo/fastapi/discussions/7319#discussioncomment-5135945
@sulaimantriarjo8097
@sulaimantriarjo8097 10 ай бұрын
what if the token is expired?
@EstesAdvTech
@EstesAdvTech 10 ай бұрын
You can use a refresh token: docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens
@a.s8840
@a.s8840 Жыл бұрын
How can I oauth with Google sign in
@EstesAdvTech
@EstesAdvTech 11 ай бұрын
Unfortunately I do t have much time to make new videos. But here’s a blog that might get you going: blog.hanchon.live/guides/google-login-with-fastapi/
@a.s8840
@a.s8840 11 ай бұрын
@@EstesAdvTech this code is very old i tried but it's didn't work
@EstesAdvTech
@EstesAdvTech 11 ай бұрын
@@a.s8840 sorry bud. I’ll see if I can get a new video soon for this.
@EstesAdvTech
@EstesAdvTech 10 ай бұрын
Just posted
An Illustrated Guide to OAuth and OpenID Connect
16:36
OktaDev
Рет қаралды 571 М.
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Summer shower by Secret Vlog
00:17
Secret Vlog
Рет қаралды 13 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 85 МЛН
Python FastAPI Secure your service with OAuth2 easily
14:40
FastAPI - Google OAuth + Drive
26:22
Will Estes
Рет қаралды 4,8 М.
Как работает OAuth 2 - введение (просто и понятно)
5:07
config.sys по-русски
Рет қаралды 42 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 122 М.
GitHub Access Tokens: How To Use Them Properly
7:33
NeuralNine
Рет қаралды 15 М.
OAuth 2.0 explained with examples
10:03
ByteMonk
Рет қаралды 114 М.
Опасность фирменной зарядки Apple
0:57
SuperCrastan
Рет қаралды 11 МЛН
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 15 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 63 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 533 М.