簡體   English   中英

使用成員資格提供程序保護WCF,但收到證書錯誤

[英]WCF Secured Using Membership Provider, but getting certificate error

我已經創建了一個自定義成員資格提供程序,並且試圖使用它來保護我的WCF服務。 但是,我收到此錯誤:

The service certificate is not provided. Specify a service certificate in ServiceCredentials.

我不想使用x509證書。 我該如何工作?

這是我的服務配置:

<?xml version="1.0"?>

<bindings>
  <wsHttpBinding>
    <binding name="wsHttpBinding1" maxBufferPoolSize="2147483647"
      maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="Message">
        <message clientCredentialType="UserName"/>
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="UpdateService.UpdateService" behaviorConfiguration="ASPNETProviders">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding1"
      contract="UpdateService.IUpdateService" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ASPNETProviders">
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="myUpdateMembershipProvider"/>            
      </serviceCredentials>
    </behavior>
    <behavior>          
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
  multipleSiteBindingsEnabled="true" />

更新

這篇博客文章, 在這里輸入鏈接描述 ,說:

[When] you opt in for the UserName client credential type, WCF insists that your service must also reference a service certificate that contains a private key.

我將在IIS中托管我的服務,並計划在網站中使用SSL證書來加密通信。 我可以使WCF不堅持引用服務證書嗎?

看來Microsoft確實非常希望我使用證書。

有人針對我的情況開發了“ 清除用戶名綁定 ”,但我認為我可能只是投降並使用證書。

您是否嘗試創建自定義憑據驗證器? 看到這個: http : //nayyeri.net/custom-username-and-password-authentication-in-wcf-3-5

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM