1

クライアントが自分自身を識別するためにメッセージに署名できるようにする https 経由の WCF 4.0 サービスがあります。その後、証明書を使用して、バックエンドでクライアントに適切な権限を付与できます。これは、WCF 4.0 クライアントが要求を送信する場合は正常に機能しますが、WCF 以外のクライアントが要求を送信しようとすると、次のエラーで失敗します:ダイジェストを計算します。クライアントの要求を検査すると、To ノードと Timestamp ノード以外のものが署名されている場合は常に、このエラーが発生します。非 WCF クライアントは、body、Action、MessageID、および ReplyTo セクションに署名する必要があります。これらの署名を期待して許可するように WCF を構成できますか?

サービス構成ファイル:

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<extensions>
  <behaviorExtensions>
    <add name="wsdlExtensions" type="MyWCFElements" />
  </behaviorExtensions>
  <bindingElementExtensions>
    <add name="httpsViaProxyTransport" type="MyWCFElements" />
  </bindingElementExtensions>
</extensions>
<behaviors>
  <endpointBehaviors>
    <behavior name="WsdlBehavior">
      <wsdlExtensions singleFile="true" />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="WebServicesServiceBehavior">
      <serviceMetadata httpsGetEnabled="false" httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceAuthenticationManager serviceAuthenticationManagerType="MyServiceAuthenticationManager" />
      <serviceAuthorization serviceAuthorizationManagerType="MyServiceAuthorizationManager" />
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MyUserNameValidator" />
        <clientCertificate>
          <authentication certificateValidationMode="PeerTrust" trustedStoreLocation="LocalMachine" />
        </clientCertificate>
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <customBinding>
    <binding name="SignedWebServicesF5BindingConfig">
      <textMessageEncoding />
      <security authenticationMode="CertificateOverTransport" allowInsecureTransport="true" requireDerivedKeys="false" securityHeaderLayout="Lax" />
      <httpsViaProxyTransport />
    </binding>
  </customBinding>
</bindings>
<services>
  <service behaviorConfiguration="WebServicesServiceBehavior" name="WebService">
      <endpoint address="signed" binding="customBinding" behaviorConfiguration="WsdlBehavior" bindingConfiguration="SignedWebServicesF5BindingConfig" contract="IWebServicesContract" name="SignedWebServices"/>
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>

4

1 に答える 1

0

Microsoft と協力した結果、CertificateOverTransport を使用してメッセージ本文に署名することはできないという回答が得られたようです。これは、クライアントが試みていたことです。MutualCertificateDuplex に移行し、応答の ProtectionLevel を ProtectionLevel.None に変更しました (応答に署名することに関心がないため)。リクエストを受信し、https 経由で応答を取得できるようになったため、トランスポート レベルではなくメッセージ レベルでメッセージのセキュリティを維持しながら、暗号化をトランスポートに依存することができます。

これが他の誰かの役に立てば幸いです。これは WCF 相互運用シナリオではかなり一般的なようですが、これに関する Web 上のガイダンスはあまりありません。

于 2011-02-14T14:35:58.637 に答える