-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
EDIT by @tomchristie: Updated title from "Authorization doesn't work when using Apache/mod_wsgi by default"
mod_wsgi normally doesn't pass through the Authorization header:
Unlike other HTTP headers, the authorisation header is not passed through to a WSGI application by default. This is the case as doing so could leak information about passwords through to a WSGI application which should not be able to see them when Apache is performing authentication...
If it is desired that the WSGI application be responsible for handling user authentication, then it is necessary to explicitly configure mod_wsgi to pass the required headers through to the application. This can be done by specifying the WSGIPassAuthorization directive in the appropriate context and setting it to 'On'.
Thus Token authentication for example does not work unless you add the following to your Apache config:
WSGIPassAuthorization on
This is very confusing as the same application on the same server works fine when run using runserver, but fails in Apache. Please could you document this in the relevant Authorization chapters?