You can also use Flask-Login to do this: https://flask-login.readthedocs.io/en/latest. With this method you can manage the users in a simple SQLite database and retrieve the user name once logged-in. I am using this method in an application I am building and it works really well with Dash.
I am currently using the Basic Auth provided by Dash. I’m trying to retrieve the username so I can map the username to unique ‘property’ and ‘region’ strings. I will then use these ‘property’ and ‘region’ strings as filters within WHERE statements within my query. I have the Dash app currently connected to BigQuery.
Thanks for suggesting the Flask-Login; I’ll take a look at that method.
Thanks for your suggestion again. I was able to set up the Flask login and connect it to my dash app. How were you able to use the retrieved username outside of the flask route definition and within the dash layout?