Trent Seed
Trent Seed

Reputation: 344

Authentication with Python, Apache, and mod_wsgi

I have been searching vigorously the last week in hopes of finding a solution to my problem. Originally, I had Python configured with CGI on my Windows, Apache, MySQL, and Python server. I understand that CGI is slow and additionally drops HTTP_AUTHORIZATION headers before executing the Python environment. I have since configured mod_wsgi and added the following to my httpd.conf:

WSGIScriptAlias /flex/entry "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/flex/entry.wsgi"
WSGIPassAuthorization On

My understanding is that HTTP_AUTHORIZATION would normally now be accessible in Python via os.environ['HTTP_AUTHORIZATION']. However, this is not the case.

Can someone please explain what I am missing/doing wrong?

Thanks! Trent

Upvotes: 1

Views: 1113

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798526

It's passed in the mapping passed as environ to the main WSGI function.

Upvotes: 1

Related Questions