1

セキュリティなしから証明書に切り替えると、IAuthorizationPolicy.Evaluate (evaluationContext.Properties.TryGetValue("Identities", out obj)?にWindowsIdentityが表示されます。これは仕様によるものですか:

これから :

<binding name="NetTcpBinding_IMyAppClientServiceRegular" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="01:00:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
          <reliableSession ordered="true" inactivityTimeout="infinite" enabled="false"/>
          <security mode="None">
            <transport clientCredentialType="None"/>
          </security>
        </binding>

これに:

<binding name="netTcpCertificate" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="01:00:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="1000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="200" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
          <reliableSession ordered="true" inactivityTimeout="infinite" enabled="false"/>
          <security>
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>

IAuthorizationPolicy.EvaluateでWindowsIdentityを取得しないようにする方法はありますか?このバインディングを使用する場合にのみ、WindowsIdentityを設定する必要があります。

<binding name="NetTcpBinding_IMyAppClientServiceWindows" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="01:00:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
          <reliableSession ordered="true" inactivityTimeout="infinite" enabled="false"/>
          <security mode="Message">
            <message clientCredentialType="Windows"/>
          </security>
4

1 に答える 1

0

<security>おそらく必要なものの代わりに、netTcpCertificate構成でモードを設定していないことに気づきました<security mode="Message">。属性を設定しないことによりmode、WCFは、証明書の資格情報に必要と思われるデフォルト値Transport代わりにデフォルト値を使用します。Messageモードがトランスポートに設定されている場合、WCFがWindows IDを渡している可能性がありますが、確認は試みていません。

更新:以下のコメントに基づいて、クライアント構成ファイルのエンドポイント>アイデンティティ>DNS>値がサーバー証明書CN=値の名前と一致することを確認する必要があります。この値は、入力した内容に基づいてMyAppServerである必要があります。

于 2013-01-30T15:06:03.020 に答える