Deploy OAuth provider with mod_wsgi

Recently I deploy an OAuth provider with apache/mod_wsgi. Everything works fine on django dev server locally, but is broken onto apache server. After analyzing the logs, it shows that the HTTP header ‘Authroization’ is dropped by default.

To pass thru OAuth parameters to mod_wsgi applications, you need to use the WSGIPassAuthorization directive. An example is like below, at the same level of ServerName directive:

Bear in mind that the ‘Authorization’ header will be passed thru and renamed to ‘HTTP_AUTHORIZATION’. You need to do such modification if you use python-oauth2 like me. I plan to submit a patch, in order to contribute and learn about git as well, LOL.


  1. WSGIPassAuthorization Directive
  2. mod_wsgi: Access Control Mechanisms
  3. My patch for python-oauth2
This entry was posted in Server and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.