Streamlit-Authenticator
Streamlit-Authenticator copied to clipboard
Feature - Store YAML file in a remote data store
It would be terrific is the user credentials could be stored in a remote data store (Deta, Mongo, etc).
I would be happy to integrate this feature if you are interested in having it incorporated.
I see a few solutions for this. But I think the simplest solution is:
- Utilize the
config.yaml
file for all config parameters, excluding thecredentials
. - Within the
config.yaml
file, users can specify how they want the credentials stored:
credential_store: "deta"
....
credential_store: "config.yaml"
....
credential_store: "credentials.yaml"
....
- We continue to store and access user credentials within the code as a dictionary. The only difference is, at load and at save, depending on the
credential_Store
option, we store or load the credentials with a specific adapter.
Hi @abdulrabbani00, I will look into this for a future release. Many thanks.
Hello @mkhorasani @abdulrabbani00 , do you think it would be possible to add a flag that appends a remote data store like Deta only after a click in verification e-mail? Say, if someone were to send a registration request from example@preauthorized_domain.com, I would like to first send an expiring link to example@preauthorized_domain.com, and only after they click on a link in their e-mail I append their name.
Technically it is possible to do if this app were to be integrated with Firebase.
Yeah that makes sense. Although tbh I have no insensitive to do it.
If you opened a pr against my branch I would be more than happy to test and merge.
@abdulrabbani00 @VovaViliLox apologies for the delay in investigating these PR's, will try to check/accept them very soon!
Yeah that makes sense. Although tbh I have no insensitive to do it.
If you opened a pr against my branch I would be more than happy to test and merge.
Yes, once I'll figure it out I for sure will open a pull request.
any update on this?
do you think it would be possible to add a flag that appends a remote data store like Deta only after a click in verification e-mail? Say, if someone were to send a registration request from example@preauthorized_domain.com, I would like to first send an expiring link to example@preauthorized_domain.com, and only after they click on a link in their e-mail I append their name.
I've implemented something similar for my app. I hold off on writing the 'create account' updated config until the user inputs a random key sent to their email using yagmail. Once they enter it, then I write their updated user config to the remote storage so the account is actually created. Using remote storage is accomplished fairly simply by just reading and writing from a remote file instead of a local file using st_files_connection.
I think adding a note to the readme that writing the local config.yaml file does not work well when hosted on the streamlit community cloud, and a remote file system will need to be used to support account creation would be a good addition.
@elmighetto , can you suggest what/where are you using for hosting your remote file and you are storing it as yaml or in db. Also you mean, once the user enters that random key, it creates credentials directly into the config.yaml on the remote file?
I will appreciate some clarity as Im trying to achieve the same.