I'm trying to see the Authorization header in Django, using mod_wsgi. I read that Apache holds back the Authorization header by default, I've put << WSGIPassAuthorization On >> in my Apache VirtualHost block and . . . nada.
How do I figure out where to put this?
You have to go to /etc/apache2/sites-enabled where your configuration file sits either the one with SSL certificates or the one without and add WSGIPassAuthorization On where the file ends.
The WSGIPassAuthorization directive can be used to control whether HTTP authorisation headers are passed through to a WSGI application in the HTTP_AUTHORIZATION variable of the WSGI application environment when the equivalent HTTP request headers are present.
Put it at same place as WSGIScriptAlias and it should work fine.
Connect to your EC2, go to etc/httpd/conf.d folder and open wsgi.conf file. Insert the code within VirtualHost DOM:
WSGIPassAuthorization On
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With