我尝试使用IIS Express 7.5(通过WebMatrix)托管的node.js编写简单的站点。 我想使用集成Windows身份验证。使用iisnode和WebMatrix进行Windows身份验证问题
我配置了applicationhost.config,就像它在一些类似的帖子中描述的那样。另外我还配置了web.config。
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<basicAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
现在,当请求站点时,它要求凭据。现在这很好。然后,我提供了正确的域凭据,并得到了一个错误401.1
那么,在信任区和Fidler的网站说Kerberos门票提供。
怎么了?
我检查跟踪,并得到了以下错误:
<EventData>
<Data Name="ContextId">{00000000-0000-0000-3F03-0080000000F8}</Data>
<Data Name="ModuleName">WindowsAuthenticationModule</Data>
<Data Name="Notification">2</Data>
<Data Name="HttpStatus">401</Data>
<Data Name="HttpReason">Unauthorized</Data>
<Data Name="HttpSubStatus">1</Data>
<Data Name="ErrorCode">2147942485</Data>
<Data Name="ConfigExceptionInfo"></Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>MODULE_SET_RESPONSE_ERROR_STATUS</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="Notification">AUTHENTICATE_REQUEST</freb:Description>
<freb:Description Data="ErrorCode">The local device name is already in use. (0x80070055)</freb:Description>
</RenderingInfo>
好了,然后我试图找出问题的几个小时,只发现如果删除规则或从网上URL重写模块。配置
<rewrite>
<rules>
<!-- Don't interfere with requests for logs -->
<rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$" />
</rule>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}" />
</rule>
<!-- All other URLs are mapped to the Node.js application entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="app.js" />
</rule>
</rules>
</rewrite>
那么一切都将工作的伟大(除app.js正确处理)
所以,我的问题s如何保留WebMatrix的原始node.js模板并使用Windows身份验证而不出现此类错误?
还有一个问题是如何获取由node.js中的IIS模块管道收集的所有上下文信息?