Quick tutorial of using the Github OAuth app flow with FastAPI.
Пікірлер: 35
@mytj2289 ай бұрын
Very good tutorial, thanks!!!
@mj206811 ай бұрын
thx this is so cool and your instructions are clear keep up
@felixreynoso3746 Жыл бұрын
awesome tutorial man
@cusematt237 ай бұрын
Great video!
@user-ye6jj9yf8g10 ай бұрын
Extremely helpful! Thanks a lot!
@gabrielmorelli2534 Жыл бұрын
Thanks dude, your video help me a lot
@EstesAdvTech Жыл бұрын
Appreciate it! Let me know if there’s other content you’d be interested in 👍
@mathis71178 ай бұрын
thank you it's perfect
@streamocu29299 ай бұрын
thank you ❤
@romanmikhailov593221 күн бұрын
great tutorial. if you could post the code in git or gist, would make it even better!
@EstesAdvTech21 күн бұрын
@@romanmikhailov5932 thanks! That is my one regret about this video, didn’t save the code 😞😞
@science_horizonts9 ай бұрын
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?
@EstesAdvTech9 ай бұрын
Multiple OAuth providers and a DB? Got it. I’ll try to get something out for you 👍
@nischalsehrawat21308 ай бұрын
Hi Will. Thanks for the mazing video. I was wondering how do you go about implementing integration testing with Oauth ?
@EstesAdvTech8 ай бұрын
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!
@nischalsehrawat21308 ай бұрын
@@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 ?
@EstesAdvTech7 ай бұрын
@@nischalsehrawat2130 I was able to find this: docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28 Hope this helps!
@a.s8840 Жыл бұрын
Can you please tell me how to do same with Google
@yiouyou4 ай бұрын
Failed to follow the example code, how the app know it should go to github-code after clicking the authorization button of github-login?
@EstesAdvTech3 ай бұрын
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 Жыл бұрын
Thank you so much, if multiple github users use this app, does github send different tokens, or everytime the same token.
@EstesAdvTech Жыл бұрын
It’ll be a different token for each user.
@alikemalagrman1067 Жыл бұрын
@@EstesAdvTech How can we refresh token without prompting to user? Can you also make a video about how security schemes work?
@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?
@ParacelsusCaspari5 ай бұрын
what if i get a CORS error? i can't even trigger the redirect
@EstesAdvTech5 ай бұрын
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?
@ParacelsusCaspari5 ай бұрын
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
@EstesAdvTech5 ай бұрын
@@ParacelsusCaspari Can you set the middleware to allow all origins? Does something like this help: github.com/tiangolo/fastapi/discussions/7319#discussioncomment-5135945
@sulaimantriarjo809710 ай бұрын
what if the token is expired?
@EstesAdvTech10 ай бұрын
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 Жыл бұрын
How can I oauth with Google sign in
@EstesAdvTech11 ай бұрын
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.s884011 ай бұрын
@@EstesAdvTech this code is very old i tried but it's didn't work
@EstesAdvTech11 ай бұрын
@@a.s8840 sorry bud. I’ll see if I can get a new video soon for this.