如何配置 Apache NTLM 以获取 REMOTE_USER?

如何配置 Apache NTLM 以获取 REMOTE_USER?

无论我将 %{REMOTE_USER} 放在哪里,我得到的都是 NULL。您能告诉我如何配置 NTLM Apache 以获取 REMOTE_USER 吗?

    RewriteEngine On
    #RewriteCond %{LA-U:REMOTE_USER} (.+)
    #RewriteRule . - [E=RU:%1]
    #RequestHeader set X-Remote-User "%{RU}e" env=RU
    #RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

    RewriteRule . - [E=RU:%{LA-U:REMOTE_USER}]
    RequestHeader set REMOTE_USER %{RU}e


    ProxyPass   "xxxx"
    ProxyPassReverse  "xxxxx"

    AuthType NTLM
    AuthName xxxxxxxxx
    PythonAuthenHandler pyntlm
    PythonOption Domain xxxxxxxxx
    PythonOption BDC xxxxxxxxxxx
    PythonOption PDC xxxxxxxxxxxxx


    RequestHeader set REMOTE_USER %{REMOTE_USER}s
    SetEnv proxy-chain-auth On
    ProxyPassInterpolateEnv On
    Header set Access-Control-Allow-Credentials "true"
    Header set Access-Control-Allow-Headers "origin, authorization, accept, X-      Requested-With, Content-Type, Content-Length"

编辑:我甚至尝试对 RequestHeader 进行硬编码,但仍然不起作用;

  RequestHeader set  X-Forwarded-User 'toto'
  RequestHeader set REMOTE_USER 'toto'
  RequestHeader set X-REMOTE-USER 'toto'
  RequestHeader set  X-Forwarded-For 'toto'

相关内容