简体   繁体   English

如何将Apache REMOTE_USER从一台Apache服务器传递到另一台?

[英]How to pass Apache REMOTE_USER from one Apache server to another?

is it possible to pass Apache's REMOTE_USER from one Apache server to another? 是否可以将Apache的REMOTE_USER从一台Apache服务器传递到另一台服务器?

My users are already authenticated in a web application on one Apache server, and now I want to redirect them to a different web application on another Apache server. 我的用户已经在一台Apache服务器上的Web应用程序中通过了身份验证,现在我想将他们重定向到另一台Apache服务器上的其他Web应用程序。 The new web application requires REMOTE_USER to already be set on the second server. 新的Web应用程序要求已在第二台服务器上设置REMOTE_USER。

It seems like this may be possible using RewriteCond. 使用RewriteCond似乎有可能做到这一点。 However, the examples I have seen all vary. 但是,我看到的示例各不相同。 I am having trouble understanding how I need to configure httpd.conf on each server. 我在理解如何在每台服务器上配置httpd.conf时遇到麻烦。

Here is what I have so far: 这是我到目前为止的内容:

Server A: (Where users are already authenticated) 服务器A :( 已对用户进行身份验证的位置)

Alias /apps C:\web\apps

#Authentication
<Directory C:\web\apps>
    AllowOverride None
    Order deny,allow
    AuthType Basic
    AuthName "Restricted Files"
    AuthBasicProvider file
    AuthUserFile C:\web\passwd\passwords
    Require valid-user
</Directory>

Server B: (Contains new web application requiring REMOTE_USER to be set) 服务器B :( 包含需要设置REMOTE_USER新Web应用程序)

    Not sure what I need to do here. Or do I only have to 
    modify configuration on Server A?

is it possible to pass Apache's REMOTE_USER from one Apache server to another? 是否可以将Apache的REMOTE_USER从一台Apache服务器传递到另一台服务器?

What do you think would happen if configure my .hpasswd file with a user littleK and password of my choice and then passed the request on to Stackoverflow? 如果使用我选择的用户littleK和密码配置.hpasswd文件,然后将请求传递给Stackoverflow,您会怎么办?

That's just not how the web works. 这不是网络的工作方式。 And one of the many reasons that Basic HTTP authentication is a really bad idea . 而且,基本HTTP身份验证确实不是一个好主意的众多原因之一。

You need to go read up on authentication in web applications, state management and how HTTP handles cookies. 您需要阅读有关Web应用程序中的身份验证,状态管理以及HTTP如何处理cookie的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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