简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM