通过 basicHTTP 绑定使用安全的 WCF 服务
我正在使用通过 basicHttpBinding 托管的安全服务 我必须将凭据传递给服务进行身份验证
这是客户端的配置设置
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
调用服务时,我收到以下异常消息
从另一方收到不安全或不正确的安全故障。有关错误代码和详细信息,请参阅内部FaultException。 Message =“提供了无效的安全令牌(错误的 UsernameToken 值)”
我不确定如何让它工作我很好奇是否有人可以帮助我或向我提供任何可以找到解决方案的网址
I am consuming an secured service hosted over basicHttpBinding
I have to pass credentials to the service for authenticatioon
Here’s the config setting for the client
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
While calling the service, I am getting following exception message
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
Message = "An invalid security token was provided (Bad UsernameToken Values)”
I not sure how to get it working I am curious if somebody can help me out or provide me any url where I could find the solution
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建
MyServiceClient
对象时,您可以在clientInstance.Credentials.UserName
对象上设置用户名和密码。When you create your
MyServiceClient
object you can set the username and password on theclientInstance.Credentials.UserName
object.