简体   繁体   English

使用ARR和URL重写从IIS转发NTLM凭据

[英]Forwarding NTLM credentials from IIS with ARR and URL Rewrite

Thanks in advance for your help. 在此先感谢您的帮助。

In my environment, I configured IIS to act as a reverse proxy and forward requests to certain paths to an application server on another host. 在我的环境中,我将IIS配置为充当反向代理,并将请求转发到另一台主机上的应用程序服务器的某些路径。 In order to do this, I used Application Request Routing (ARR) and URL Rewrite modules, I create my rule and everything's working fine. 为了做到这一点,我使用了应用程序请求路由(ARR)和URL重写模块,我创建了我的规则,一切正常。

IIS is responsible to authenticate clients using NTLM, so my question is: is it possible to pass the authentication credentials (at least the username) to my application server after authenticating the user? IIS负责使用NTLM对客户端进行身份验证,因此我的问题是:在对用户进行身份验证后,是否可以将身份验证凭据(至少是用户名)传递给我的应用程序服务器?

I tried to do this adding a custom header to my requests, writing a rule like this: 我尝试这样做,为我的请求添加一个自定义标头,编写如下规则:

<rule name="ForwardToApplicationServer">
<match url=".*" />
<serverVariables>
<set name="HTTP_AUTH_USER" value="{AUTH_USER}" />
</serverVariables>
<action type="Rewrite" url="http://myappserver/myapp/{R:0}" logRewrittenUrl="true" />
</rule>

But it doesn't work: when I read it on my application my header is alwasy empty. 但它不起作用:当我在我的应用程序上阅读它时,我的标题是空的。 I also tried with and but none of these worked. 我也试过,但没有一个工作。

So, what am I doing wrong? 那么,我做错了什么? Should I use another server variable? 我应该使用其他服务器变量吗? Am I missing something? 我错过了什么吗?

More in general: is it possible to do what i'd like to do? 更一般的说:是否有可能做我想做的事情?

Again, thanks in advance for your help, and please forgive me if I'm asking something obvious but I'm new to using IIS and I couldn't find anything that helped me. 再次,在此先感谢您的帮助,请原谅我,如果我问一些明显但我不熟悉使用IIS,我找不到任何帮助我的东西。

http://weblogs.asp.net/owscott/an-intro-to-iis-url-rewrite-plus-redirecting-urls-to-www-web-pro-week-8-of-52 http://weblogs.asp.net/owscott/an-intro-to-iis-url-rewrite-plus-redirecting-urls-to-www-web-pro-week-8-of-52

{REMOTE_USER}, {LOGON_USER} & {AUTH_USER} do not work with URL-REWRITE, ... 

You can use www.isapirewrite.com which runs later in the stack and has a handle on the auth data. 您可以使用www.isapirewrite.com ,它将在堆栈中运行,并具有auth数据的句柄。

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

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