-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logout from basic auth #51
Comments
Here you go for a dirty hack:
What it does: Problems:
There is no solution for the "UX" issue, but the |
I've written a Button component with Big big caveat: I am not yet sure that it's safe, at all! See this code review question. Code is here: https://github.com/lbke/dash-standard-button Again not sure it's safe yet!
A better process would be to install BasicAuth a bit differently. You would need to have at least one insecure route on Then, in the frontend, you can create a Dash component displaying a login form, in which you would store the login token on your own, in the Basically the logout issue is strongly related to the fact that we rely on browser magic. Yet, usually, browsers magic is complete crap (I mean, not being able to log out without closing the browser is an open door to social engineering...). However note that this behaviour ties your login process to your frontend, while Plotly default behaviour is standard, and as far as I understand the code, it's secure. |
@eric-burel Thank you for the detailed instructions and code for the button. Is it possible for you to kindly tell us where to put the code for |
Hi, the logout call will go into the button I won't provide a repo because that's more a hack, but the code I've posted should be sufficient. |
Okay @eric-burel Thank you for the instructions. I will try. |
Is there any way to logout from basic auth in these examples? The only way I can possibly think is if you did a redirect with a 401 status code. I'm just looking for a simple way to circumvent this problem for now.
I've looked at the docs on https://dash.plot.ly/authentication and understand that one of the limitations of
dash_auth.BasicAuth
is that users cannot logout of applications, but there must be a way to use flask routing to return a 401 unauthorized.If anyone has figured out a way around the problem, I'd love to hear some suggestions!
The text was updated successfully, but these errors were encountered: