使用iisnode和WebMatrix进行Windows身份validation

我尝试使用IIS Express 7.5(通过WebMatrix)托pipe的node.js编写一个简单的站点。 我想使用集成的Windows身份validation。

我configuration了一些类似的文章中描述的applicationhost.config 。 另外我也configuration了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> 

好的,然后我试图找出几个小时的问题,只发现如果从web.config中删除规则或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)

所以,问题是如何保留WebMatrix的原始node.js模板,并使用Windows身份validation没有这样的错误?

还有一个问题是如何获取通过node.js中的IIS模块pipe道收集的所有上下文信息?

从iisnode v0.1.13开始,由IISpipe道收集的信息不会暴露给node.js应用程序。 这是一个已知的限制,将通过https://github.com/tjanczuk/iisnode/issues/87和https://github.com/tjanczuk/iisnode/issues/94解&#x51B3; 。

使用重写规则时的身份validation问题需要调查; 创buildhttps://github.com/tjanczuk/iisnode/issues/127 。

Interesting Posts