How do I deploy Dash to Elastic Beanstalk with Basic Authentication

Hi,
I have followed the documentation on setting up authentication for Dash and works correctly locally. However when I tried to deploy the Dash app to AWS by Elastic Beanstalk, it won’t accept the username and password pair. I have searched on line and it seems to be related to the fact that AWS removes the Authentication Header from the HTTP request.

People suggests to include a file named python.config

container_commands:
03wsgipass:
command: ‘echo “WSGIPassAuthorization On” >> …/wsgi.conf’

to .elasticbeanstalk folder.

I have tried that without much luck.

What should I do ?

I have this exact same problem, have you found a solution ?

I struggled with this for hours. It looks like AWS changed the filename requirements over time without any documentation that I could find.

It was finally fixed when I changed the filename to wsgi_custom.config, and saved it in .ebextensions, not .elasticbeanstalk, although I have it in both places for good measure.

It seems like it has to be .config, not .conf.

Here’s the content of my .ebextensions/wsgi_custom.config" file:

files:
    "/etc/httpd/conf.d/wsgi_custom.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
    WSGIPassAuthorization On
2 Likes

Worked like a charm! Thank you very much!

ALMOST worked like a charm. The wsgi_custom.config file needs to be properly indented; a copy-paste from the script above failed to do this.
Create the file

.ebextensions/wsgi_custom.config

with the following content

files:
     "/etc/httpd/conf.d/wsgi_custom.conf":
          mode: "000644"
          owner: root
          group: root
          content: |
              WSGIPassAuthorization On
3 Likes