2011-10-20 14 views
1

アプリケーションプールを実行しているドメインアカウントを使用して、ホストされたWCFサービス、IIS7で.net 3.5sp1を使用します。私はWindows認証、wsHttpBinding、および匿名をオフにする必要があります。Windowsの認証のみでIIS7のWCFサービスでwsHttpBinding

このサービスのセキュリティ設定には「匿名」認証が必要ですが、このサービスをホストするIISアプリケーションでは有効になっていません。

約50種類のweb.config設定を試しましたが、喜びはありません。

現在のweb.configファイル:

<system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="PressReleaseService.PRBehavior"> 
       <serviceMetadata httpGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="true" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="PressReleaseService.PRBehavior" name="PressReleaseService.PR"> 
      <endpoint address="" binding="wsHttpBinding" contract="PressReleaseService.IPR"> 
       <identity> 
        <dns value="localhost"/> 
       </identity> 
      </endpoint> 
     </service> 
    </services> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="WSHttpBinding_IPR" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" 
      transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" 
      textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
       maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <reliableSession ordered="true" inactivityTimeout="00:10:00" 
       enabled="false" /> 
       <security mode="Message"> 
        <message clientCredentialType="Windows" negotiateServiceCredential="false" 
        algorithmSuite="Default" establishSecurityContext="true" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
</system.serviceModel> 

また、同じアプリケーションプールの下で実行されている他のサービスがあり、それはそれでmexでいるが、主要エンドポイントのwsHTTPBindingを持っており、それはWindows認証のみがで有効になっていますIIS。

手がかりはありますか?

答えて

2

IIS7での解決策:

web.configファイルに次の行:

<serviceMetadata httpGetEnabled="true" /> 

は、匿名アクセスがHTTPアクセスのための.SVCファイルに付与することが必要です。これを許可するには、IISマネージャーを開き、匿名認証を無効にし、アプリケーションの上部でWindows認証を有効にします。次に、 'コンテンツビュー'タブに移動し、.svcファイルを右クリックします。 '機能ビューに切り替え'を選択してください。これにより、.svcファイルが左側のディレクトリツリーに追加されます。そこから、IISの下で「認証」に行き、匿名認証を有効にすることができます。これでmexエンドポイントへの匿名アクセスが可能になりました(私はそれを元に戻しました)が、どこにでもWindows認証を持っています。この結果は、次のようなc:\ Windows \ System32 \ inetsrv \ config \ applicationHost.configファイルの変更です。

<location path="Default Web Site/PRService_Dev"> 
    <system.webServer> 
     <security> 
      <authentication> 
       <anonymousAuthentication enabled="false" /> 
       <windowsAuthentication enabled="true" /> 
      </authentication> 
     </security> 
    </system.webServer> 
</location> 
<location path="Default Web Site/PRService_Dev/PR.svc"> 
    <system.webServer> 
     <security> 
      <authentication> 
       <anonymousAuthentication enabled="true" /> 
      </authentication> 
     </security> 
    </system.webServer> 
</location> 
0

トランスポートセキュリティを使用して、IISに認証を委任し、IISで構成した設定を使用する必要があります。この場合のWindows認証。 clientCredentialTypeと

<セキュリティモード= "交通" > <輸送clientCredentialType = "Windowsの"/> < /セキュリティ>

メッセージ認証を使用すると、これだけ匿名を有効にする必要があるのKerberosとのメッセージセキュリティをしたいということを意味しますIIS上で。

関連する問題