dnplus / streamlit-oauth

Simple OAuth Component for Streamlit App
MIT License
111 stars 18 forks source link

Cloud Deploy read error #10

Closed geraldcor closed 7 months ago

geraldcor commented 7 months ago

I am attempting to use this for Google oAuth2. When I authorize, I get the following error:

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/web/server/component_request_handler.py", line 55, in get

    with open(abspath, "rb") as file:

IsADirectoryError: [Errno 21] Is a directory: '/home/adminuser/venv/lib/python3.9/site-packages/streamlit_oauth/frontend/dist'

My code structure is like:

your-repository/
├── .streamlit/
│   └── config.toml
├── your_app.py
└── requirements.txt

and in config.toml I have

[server]
enableCORS = false
enableXsrfProtection = false

Others seem to have fixed that problem but I'm not sure how specifically this accomplished this.

dnplus commented 7 months ago

Hi @geraldcor I have uploaded a workable demo app.

You could reference it.

https://github.com/dnplus/streamlit-oauth-cc-demo https://g-openid-demo.streamlit.app/

And I have set environments

GOOGLE_CLIENT_ID = "XXXXX.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET = "XXXXX"
GOOGLE_REDIRECT_URI = "https://g-openid-demo.streamlit.app/component/streamlit_oauth.authorize_button"
geraldcor commented 7 months ago

This worked perfectly. localhost still fails to reload but that's not a huge problem. Thank you so much for a great component