Skip to content

Document default Apache/mod_wsgi Authorization header behavior. #488

@qris

Description

@qris

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions