Mat*_*eis 25 wcf web-config wcf-binding servicebehavior
当我尝试调用WCF服务时,我收到以下消息"验证邮件的安全性时出错".
当我删除自定义验证时,服务没有问题.虽然我在web.config中配置错误,但我无法弄清楚.任何见解将不胜感激.
<system.serviceModel>
<services>
<service behaviorConfiguration="NAThriveExtensions.nableAPIBehavior"
name="NAThriveExtensions.nableAPI">
<endpoint
address=""
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_Secure"
contract="NAThriveExtensions.InableAPI">
</endpoint>
<endpoint
address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="NAThriveExtensions.nableAPIBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType= "NAThriveExtensions.Authentication, NAThriveExtensions" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_Secure">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
Sam*_*Sam 35
我收到同样的错误消息,结果是由于我的工作站机器和托管WCF服务的服务器之间的时间差异.服务器在我的机器后面大约10分钟,WCF安全性似乎不太喜欢.
为了找到根问题,我在服务器的配置文件中打开了serviceSecurityAuditing.将以下内容添加到服务的configuration/system.serviceModel/behavior/serviceBehaviors/behavior部分:
<serviceSecurityAudit
auditLogLocation="Application"
serviceAuthorizationAuditLevel="Failure"
messageAuthenticationAuditLevel="Failure"
suppressAuditFailure="true"/>
Run Code Online (Sandbox Code Playgroud)
以下网站有助于解决这个问题:
ash*_*999 17
此消息的另一个原因是您的某些计算机未及时同步.默认情况下,WCF允许五分钟的差距; 除此之外,如果事情不同步,它会抛出错误.
解决方案是同步所有机器.time.windows.com因为不工作而臭名昭着,所以我建议使用别的东西.(如果您在公司环境中,本地域控制器可能是正确的选择.)
这最终成为消费方面的问题,而不是服务本身.Software AG的webMethods 8正在使用此服务器,但没有向服务添加安全处理程序,因此凭据未添加到标头中,从而导致上述错误.
| 归档时间: |
|
| 查看次数: |
42975 次 |
| 最近记录: |