Now I use a slightly different approach. The sahutchi solution worked until the env variables were changed, as Tom Deakin pointed out. I went a little deeper inside EB and found out where the wsgi.conf template is, and added the option "WSGIPassAuthorization On" there.
commands: WSGIPassAuthorization: command: sed -i.bak '/WSGIScriptAlias/ a WSGIPassAuthorization On' config.py cwd: /opt/elasticbeanstalk/hooks
This will always work even when changing environment variables. I hope you find this helpful.
Edit: It seems that many people still come across this answer. I have not used ElasticBeanstalk after a while, but I would consider using the Manel Clos solution below. I have not tried this personally, but it seems a much cleaner solution. This will literally hack into EBs scenarios and could potentially be interrupted in the future if the EB updates them, especially if they move them to another location.
Rubén Durá Tarí Mar 13 '15 at 11:58 2015-03-13 11:58
source share