I am looking to deploy my Streamlit app to Digital Ocean… but there’s a problem.
My app uses st.login() which gets my Auth0 login credentials from the secrets.toml stored variables. However, there’s no place for me to pload my secrets file securely in Digital Ocean.
I can’t assign the credentials to environmental variables because Streamlit’s st.login() looks specifically for a secrets.toml file.
I don’t want to hard code my secrets in a secrets.toml file when I deploy my app, so what should I do to get st.login() to work on the deployed app?
I don’t think so, DigitalOcean App Platform (where I want to deploy it) only supports adding secrets as encrypted environment variables. Is there a way where I can just define the st.login() credentials in my python code as Digital Ocean Environmental Variables instead of needing to use the secrets.toml file?
Alternatively, someone suggested a workaround in a GitHub issue thread. Since it uses internal Streamlit methods, I can’t offer any guarantee on which versions of Streamlit would support it or if it would satisfy best security practices, though:
The GitHub comment proposes a good workaround, thank you very much for linking me to it!
Hopefully Streamlit will be updated to accept environmental variables for the st.login() function natively (instead of requiring a secrets.toml file no matter what) in the near future.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.