Black Lives Matter. Please consider donating to Black Girls Code today.

Pass credentials to basic authentication so user doesn't have to type it

I have a dash app (call it charts) that gets spawned from another dash app (call it main). The user is already signed in on the main page and I would like to pass those credentials to the charts page when they are redirected so they don’t have to re-enter user/pass info.

The reason I have to have authentication on the charts page is so some rando can’t just type the url and gain access to the personalized charts page of another user.

Does anyone have any idea how I could get basic auth to accept credentials behind the scenes like that?

Thanks!
Nathan

Still looking for any suggestions. Unfortunately, I do not think I can use flask style endpoint security (@login_required,etc) because the target of the endpoint is a flask.redirect to a brand new and separate dash app with its own url:port. Flask endpoint security on the main page will not prevent someone from opening up a completely new browser with a fresh session and typing in the chart app address right into the url.

I really like the idea of having basic auth on the chart app, and then if it is being accessed by a redirect from the main app, we somehow pass credentials to the basic auth (kind of like when you refresh a page you are already signed into, it doesn’t make you sign in again.)