Firstly your component is a great contribution to the Streamlit community and I have enjoyed reading your (recently purchased!) book.
I have been able to successfully get your Streamlit-Authenticator app working locally by having a config.yml setup in my root directory. I use the example structure you have provided in your documentation, replacing the passwords with hashes with your hash encryptor.
However, I am unsure how I specify those same credentials when I go to deploy my app on Streamlit Community Cloud (as a private app) within the Secrets manager. I would rather not have my config.yml file hosted secretly on GitHub and would rather just specify those credentials in Secrets manager.
Can you (or anyone else really ) please help me with the correct specification in Streamlit secrets manager?
Hey @C_Quang thank you for purchasing our book! I see that this question has already been answered above, so I just wanted to take this opportunity to say thank you.
Hi @mkhorasani sorry for the late reply. I am really eager to try the solution @ferdy posted above. Do you know whether that solution would also work in other secrets management functions for other services .e.g like Render etc.?
BTW - I’m still making my way through your book. Great read and covers some really important material front end and back end.
Hey @C_Quang, I’m not sure about other services, but as long as such services can take a dictionary, then I can’t imagine it being a problem. And that’s great to hear that you’re enjoying the book, thank you so much for making the purchase!
Would this approach also allow for the implementation of a “register user” functionality? Basically, is there a way to update the secrets as someone registers as a new user? Thanks!
I get a “TypeError: Secrets does not support item assignment.” error when I try to use secrets.toml instead of config.yaml (both in the .streamlit folder) for streamlit_authenticator. I’d appreciate any suggestions.
thanks for your prompt response. I don’t believe i am assigning values to secrets’ items in the code. I copied the code directly from the Mar 2023 post in this topic. Here is the full error message:
TypeError: Secrets does not support item assignment.
Traceback:
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.__dict__)File "/Users/xxxxxxxxxxxl/Sites/ftr-stream/mainLogin1.py", line 110, in <module>
authenticator = stauth.Authenticate(
^^^^^^^^^^^^^^^^^^^^File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/streamlit_authenticator/authenticate.py", line 49, in __init__
self.credentials['usernames'][username]['logged_in'] = False
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/streamlit/runtime/secrets.py", line 105, in __setitem__
raise TypeError("Secrets does not support item assignment.")
Hello, I landed on this thread because I was facing the following problem;
Every time I would push code and the app re-deploys, all previously registered users disappear, except those that I had hard-coded in the config.yaml.
Now with the solution of using st.secrets as a store for the user details, my question is, how do I programmatically update my secrets everytime a new user is registered or an edit is made?
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.