将用户名从apache Basic Authentication传递到cherrypy
我需要为我的应用程序的一部分使用Apache基本身份validation。 我想从Apache获得authentication的用户名,但我似乎无法find在哪里访问它。 我可以在apache日志中看到用户名,所以我知道它在某处。 用户通过apachevalidation后,请求通过代理发送到cherrypy服务器。 这里是我的apache vhostconfiguration部分: <Location /ical> AuthType Basic AuthBasicProvider ldap AuthName "Example Calendar Login" AuthLDAPUrl "ldaps://ldap.example.net/ou=People,dc=example,dc=net?uid" Require valid-user ProxyPass http://localhost:8082/ ProxyPassReverse http://localhost:8082/ SetEnv proxy-nokeepalive 1 </Location> 用户authentication和代理位工作得很好。 一旦请求被authentication并发送到cherrypy,这里是我在cherrypy中的头文件: (Pdb) pp cherrypy.request.headers {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Accept-Encoding': 'gzip,deflate', 'Accept-Language': 'en-us,en;q=0.5', 'Authorization': 'Basic xxxxxxxxxxx', 'Connection': 'close', 'Host': 'sub.example.net', 'If-None-Match': 'e5b0879ce68fcce5b960ce4281c8d706', 'Remote-Addr': '10.132.32.86', 'User-Agent': 'Mozilla/5.0 (X11; […]