Trying to figure out what user authentication option will work best for a Dash app I'm building

I’d like to enable user authentication within a demo Dash app that I’m working on. Ideally, the authentication method would allow different content to be shown to users depending on their username and would cooperate well with multi-page Dash apps. Ease of use is also a plus, but I’m willing to put in time to learn a more complex authentication method, as I’m sure this will prove useful for real-life apps also.

It appears that there are a number of different free authentication methods that I could potentially use:

  1. dash-auth (looks very simple and straightforward; could this work for a production app, or is it better to use one of the following options?)

  2. flask-login (seems very popular)

  3. flask-dance (appears to be a good option if I need to support OAuth login methods in the future)

  4. Moving my Dash app over to Django and using its built-in authentication methods

Before I commit to a given method, I’d love to hear what has worked best for you. Also, for flask-login or flask-dance, would it be best to set up a generic flask app and then add Dash into that app? (Example of this method)

I think that dash-auth is too simple for most use cases. For me, the fact that user cannot logout was a dealbreaker. But if you can live with its limitations, I guess it could be a valid option.

I have previously used Keycloak with Dash, as I needed UM as well as LDAP intragration. It takes a bit of setup, but it works well.

The other Flask options also seem like solid choices, so I would say that it comes down to the needs you have for the auth mechanism.

6 Likes