Search code examples
pythonplotly-dashhttp-status-code-401plotly-python

Plotly 'Dash Auth' Login Throws 401 Error. How to get 200?


I’ve deployed my first application today utilizing plotly Dash and I’m using Dash Auth as my authentication to login to the application.

However, the way our system works, it’s dependent on a ‘health check’ which requires a given URL from the dash app to return a 200 status code to ensure the site is running well. From my understanding, the Dash Auth throws a 401 error first to display the login page, then returns either 200 or 403 based on the input.

This initial 401 then crashes our system because it’s expecting a 200 for the health check.

My question is, what link can I supply our system so that I get a 200 status code returned instead of the 401 while still using Dash Auth? The base path, like url.com/ seems to throw the 401 still. Thank you!


Solution

  • You need to create a login page which can send 200 response.

    or else simple solution is to add 401 as a required success code in EC2 Target Groups as 401 means unauthorized error.

    Process:

    EC2 -> Load balancing -> Target groups -> select target group -> health checks -> set Success Codes as 401.