3

我正在通过 Apache2 的 authnz_ldap 模块成功验证 ldap 用户。我不清楚他们登录后如何获取他们的用户名,以便我可以通过以下任何表单/网页与他们交互。我已经尝试过典型的方法(os.getenv os.environ getpass 等),但它们要么只给我 www-data 要么给我 None 结果。

我怀疑我需要的东西在 apache/ldap 模块中都可用,但我可以使用一些帮助来搜索正确的路径。谁能指出我正确的方向?

4

1 回答 1

1

To answer my own question: http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html#exposed

Although the environment key was not documented, i threw in a few likely suspects and found that os.getenv('AUTHENTICATE_UID') was the winner.

I hope this saves someone some time.

于 2012-09-08T19:57:44.193 回答