小编F.T*_*F.T的帖子

如何在HTTP标头中设置REMOTE_USER?

我的Apache设置有问题.

我安装了部分接受外部身份验证的Web应用程序:

  • 我使用Apache来管理对我的应用程序网页的访问.
  • 如果身份验证成功,则使用用户名设置环境变量REMOTE_USER.
  • 然后通过HTTP标头将用户名传递给我的应用程序,以便在用户会话上打开应用程序.
  • 这主要是应用程序的Apache配置.我只在我的应用程序配置文件中设置包含用户名的变量(HTTP标头)的名称.

这是问题:我可以成功进行身份验证(大多数情况下)但我的HTTP标头设置为null.

一些额外的细节:

  • 我使用Apache和mod_perl模块(AuthenNIS + AuthzNIS + Net-NIS)通过NIS帐户向我的应用程序进行身份验证.
  • 使用以下Apache配置文件,当我尝试访问我的应用程序但是REMOTE_USER标头设置为null时,我有身份验证表单.

        Listen 2208
        <VirtualHost *:2208>
    
                    RewriteEngine on
                    DocumentRoot "/path/to/static"
    
    
                    <Directory "/path/to/static">
    
                                Options +Indexes FollowSymLinks MultiViews
                                AllowOverride None
                                Order allow,deny
                                Allow from all
    
    
                                AuthType Basic
                                AuthName "Authentifiez vous"
                                PerlAuthenHandler Apache2::AuthenNIS
                                PerlAuthzHandler Apache2::AuthzNIS
                                PerlSetVar AllowAlternateAuth no
                                require valid-user
    
                    </Directory>
    
    
                    RewriteEngine on
                    RewriteRule . - [E=RU:%{LA-U:REMOTE_USER}]
                    RequestHeader set REMOTE_USER %{RU}e
    
                           RewriteRule ^/apps$ /apps/ [R]
                           RewriteRule ^/static/style/(.*) /path/to/static/june_2007_style/blue/$1 [L]
                           RewriteRule ^/static/scripts/(.*) /path/to/static/scripts/packed/$1 [L]
                           RewriteRule ^/static/(.*) /path/to/static/$1 [L]
                           RewriteRule ^/favicon.ico /path/to/static/favicon.ico [L] …
    Run Code Online (Sandbox Code Playgroud)

apache authentication header http

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

apache ×1

authentication ×1

header ×1

http ×1