I actually ran into the exact same struggle recently when trying to get Google Picker working in a Streamlit app (though I didn’t try it with ngrok). I’m more of a Python person too, so mixing in the JavaScript OAuth flow was… let’s just say “fun.” 😅
In the end, I decided to build a Streamlit component for it — wraps the Google Picker API and works with a normal OAuth2 flow in Python.
It supports:
Picking files or folders from Google Drive
Multi-select
Filtering by file type/MIME type
Returns st.file_uploader
-style Python UploadedFile
objects you can read right away
You can install it with:
pip install streamlit-google-picker
Might save you from fighting with the JavaScript side — and even if I didn’t try it with ngrok, there’s no reason it shouldn’t work.
You can also check the right way to setup the google cloud settings : Demo + setup google cloud guide (Medium)