Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with Windows Authentication using iisnode and WebMatrix
    primarykey
    data
    text
    <p>I tried to write a simple site using node.js hosted on IIS Express 7.5 (via WebMatrix). I would like to use Integrated Windows Authentication.</p> <p>I configured <strong>applicationhost.config</strong> as it described in some similar posts. Also i have configured <strong>web.config</strong> as well.</p> <pre><code>&lt;system.webServer&gt; &lt;security&gt; &lt;authentication&gt; &lt;anonymousAuthentication enabled="false" /&gt; &lt;basicAuthentication enabled="false" /&gt; &lt;windowsAuthentication enabled="true" /&gt; &lt;/authentication&gt; &lt;/security&gt; &lt;/system.webServer&gt; </code></pre> <p>Now, when request the site it ask for credentials. That's pretty good for now. Then i provide correct domain credentials and got an error <strong>401.1</strong></p> <p>Well, the site in trusted zone and Fidler said Kerberos tickets provided.</p> <p>What's wrong?</p> <p>I checked trace and got the following error:</p> <pre><code>&lt;EventData&gt; &lt;Data Name="ContextId"&gt;{00000000-0000-0000-3F03-0080000000F8}&lt;/Data&gt; &lt;Data Name="ModuleName"&gt;WindowsAuthenticationModule&lt;/Data&gt; &lt;Data Name="Notification"&gt;2&lt;/Data&gt; &lt;Data Name="HttpStatus"&gt;401&lt;/Data&gt; &lt;Data Name="HttpReason"&gt;Unauthorized&lt;/Data&gt; &lt;Data Name="HttpSubStatus"&gt;1&lt;/Data&gt; &lt;Data Name="ErrorCode"&gt;2147942485&lt;/Data&gt; &lt;Data Name="ConfigExceptionInfo"&gt;&lt;/Data&gt; &lt;/EventData&gt; &lt;RenderingInfo Culture="en-US"&gt; &lt;Opcode&gt;MODULE_SET_RESPONSE_ERROR_STATUS&lt;/Opcode&gt; &lt;Keywords&gt; &lt;Keyword&gt;RequestNotifications&lt;/Keyword&gt; &lt;/Keywords&gt; &lt;freb:Description Data="Notification"&gt;AUTHENTICATE_REQUEST&lt;/freb:Description&gt; &lt;freb:Description Data="ErrorCode"&gt;The local device name is already in use. (0x80070055)&lt;/freb:Description&gt; &lt;/RenderingInfo&gt; </code></pre> <p>Ok, then i was trying to figure out the problem for few hours and only found that if remove rules or <strong>URL Rewrite Module</strong> from web.config</p> <pre><code> &lt;rewrite&gt; &lt;rules&gt; &lt;!-- Don't interfere with requests for logs --&gt; &lt;rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true"&gt; &lt;match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$" /&gt; &lt;/rule&gt; &lt;!-- First we consider whether the incoming URL matches a physical file in the /public folder --&gt; &lt;rule name="StaticContent"&gt; &lt;action type="Rewrite" url="public{REQUEST_URI}" /&gt; &lt;/rule&gt; &lt;!-- All other URLs are mapped to the Node.js application entry point --&gt; &lt;rule name="DynamicContent"&gt; &lt;conditions&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="app.js" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; </code></pre> <p>then all will work great (except the correct handling of app.js)</p> <p>So, the question is how to keep original node.js template for WebMatrix and use Windows Authentication without such error?</p> <p>One more question is how to get all Context info collected by pipeline of IIS modules in node.js ?? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload