以下是我的WCF服务的web.config的一部分:
<bindings>
<basicHttpBinding>
<binding name="sslBinding">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" algorithmSuite="Default" />
<transport />
</security>
</binding>
</basicHttpBinding>
</bindings>
当客户端尝试使用我的服务时,我究竟在哪里检查用户名?是否有一些方法我必须覆盖以验证用户名?
答案 0 :(得分:6)
<behaviors>
<serviceBehaviors>
<behavior name="behavior">
<serviceCredentials>
<userNameAuthentication customUserNamePasswordValidatorType="myType, assembly" userNamePasswordValidationMode="Custom"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>