27

この投稿の提案を試してみましたが、Vision Studio 2010 の IIS Express で Windows 認証を使用できません。次のエラーが表示されます。 401.2 エラー

私のapplicationhost.configファイルのエントリは次のとおりです。

...
<add name="WindowsAuthenticationModule" lockItem="false" />
...
<authentication>

    <anonymousAuthentication enabled="true" userName="" />

    <basicAuthentication enabled="false" />

    <clientCertificateMappingAuthentication enabled="false" />

    <digestAuthentication enabled="false" />

    <iisClientCertificateMappingAuthentication enabled="false">
    </iisClientCertificateMappingAuthentication>

    <windowsAuthentication enabled="true" />
</authentication>
...
<sectionGroup name="authentication">
    <section name="anonymousAuthentication" overrideModeDefault="Allow" />
    <section name="basicAuthentication" overrideModeDefault="Allow" />
    <section name="clientCertificateMappingAuthentication" overrideModeDefault="Allow" />
    <section name="digestAuthentication" overrideModeDefault="Allow" />
    <section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Allow" />
    <section name="windowsAuthentication" overrideModeDefault="Allow" />
</sectionGroup>

私のweb.config:

<system.web>
    <authentication mode="Windows" /> 
</system.web>
<system.webServer>
    <security>
        <authentication>
            <anonymousAuthentication enabled="false" />
            <windowsAuthentication enabled="true" />        
        </authentication>
    </security>
</system.webServer>

これは.NET 4です

4

3 に答える 3

38

applicationhost.configファイルに次のようなものがあることを確認してください

<windowsAuthentication enabled="true">
  <providers>
    <add value="Negotiate" />
    <add value="NTLM" />
   </providers>
</windowsAuthentication>

このファイルはおそらくにあります%HOMEPATH%\Documents\IISExpress\config\

于 2011-04-27T15:43:23.687 に答える
0

以下を web.config に追加してみてください。

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
    <security>
        <authentication>
            <windowsAuthentication enabled="true" />
        </authentication>
    </security>
</system.webServer>
于 2011-04-21T14:49:05.227 に答える