Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I put "WSGIPassAuthorization On"?

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?

like image 898
chernevik Avatar asked Mar 20 '12 03:03

chernevik


People also ask

How do I enable WSGIPassAuthorization?

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.

What is WSGIPassAuthorization?

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.


2 Answers

Put it at same place as WSGIScriptAlias and it should work fine.

like image 56
Graham Dumpleton Avatar answered Oct 07 '22 08:10

Graham Dumpleton


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]
like image 24
Ronaldo Bahia Avatar answered Oct 07 '22 08:10

Ronaldo Bahia