As a data analyst, do you wonder what it takes to add Google Authentication to your Python web app in Streamlit? Well, I tried it, it was a painful challenge...and I feel like a backend developer now. You will see how to:
- Configure OAuth secrets
- Use the Google oauth Python client to authenticate with your Google account
- Build the OAuth flow in a separate FastAPI
After this video, you will have a good understanding of the OAuth2 process in Python Web apps.
00:00 Intro
00:32 Create OAuth Secrets
02:20 google-auth-oauthlib
05:21 Moving OAuth 2 out of Streamlit
10:22 Session-based Authentication
13:11 Support Me!
13:32 Moving OAuth 2 back Into Streamlit
15:43 Ideas for a future video
---
🗣️ Stay up to date with the Data Web App Ecosystem
- 📑 Follow my socials ➡ https://andfanilo.com
- 📧 Get my latest updates in your inbox ➡ https://newsletter.andfanilo.com
- 💰 Buy me a coffee to stay awake while editing ➡ https://www.buymeacoffee.com/andfanilo
🔗 Links
- Project Source Code: https://github.com/andfanilo/streamlit-google-authentication-tests
- Native OAuth2 in Streamlit is coming: https://github.com/streamlit/streamlit/issues/8518
- Streamlit OAuth plugins:
- streamlit_oauth: https://github.com/dnplus/streamlit-oauth
- streamlit-google-auth: https://github.com/MrBounty/streamlit-google-auth
- st_oauth: https://github.com/sfc-gh-bhess/st_oauth
- google-auth-oauthlib: https://googleapis.dev/python/google-auth-oauthlib/latest/index.html
- Authlib: https://authlib.org/
- requests-oautlib: https://requests-oauthlib.readthedocs.io/en/latest/
- Google Signin Button: https://developers.google.com/identity/gsi/web/guides/overview
🔧 My tools (Affiliate links to support me)
- 📕 Streamlit Official Book - https://amzn.to/3QuRPwl
- 📷 Main Camera - https://amzn.to/3QvTosB
- 📷 Main Lens - https://amzn.to/3svYCwq
- 🎙️ Microphone - https://amzn.to/47l5ewA
- 🎵 Music & Sound Effects - https://www.epidemicsound.com/referral/a2p22s
---
🪶 I don't feel like building an auth system after doing this, I'll be using Auth As A Service from now on ahah
⚠️ Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. Thank you for supporting my channel so I can continue providing you with free content!
#streamlit #python #datascience #dataapps