在 IssuedTokenOverTransport 身份验证模式下访问 WCF 服务时出现 SecurityAccessDenied 异常
我有一个 WCF 服务托管在我的本地 IIS 中,我正在尝试从我的 Windows 应用程序访问它。绑定使用身份验证模式“IssuedTokenOverTransport”
我在同一 IIS 中托管了另一个服务,该服务发出 SAML 令牌。 Windows 应用程序首先调用此服务,获取此服务颁发的 SAML 令牌,并使用相同的令牌调用 WCF 服务。
获取SAML令牌没有问题。但是,当使用相同的 SAML 令牌调用 WCF 服务时,我收到“SecurityAccessDenied”异常:“无法验证消息中的至少一个安全令牌。”
有人可以帮我解决这个问题吗?我想通过 HTTPS 访问服务。
I have a WCF service hosted in my local IIS and I'm trying to access it from my windows application. The binding uses the authentication mode as 'IssuedTokenOverTransport'
I have another service hosted in the same IIS which issues a SAML token. Windows application first calls this service, takes the SAML token issued by this service and uses the same token to call the WCF service.
There is no problem in getting the SAML token. But when WCF service is called with the same SAML token, I get the 'SecurityAccessDenied' exception : 'At least one security token in the message could not be validated.'
Can someone help me t get rid of this issue? I want to access service over HTTPS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在服务器证书上。在 web.config 中,服务器证书配置为certificateValidationMode="PeerTrust"。这是在“受信任的人”存储中期待该服务器证书,但该证书在那里不可用。当我把它复制到那里时,问题就解决了!
The problem was with the server certificate. In web.config, the server certificate was configured with the certificateValidationMode="PeerTrust". This was expecting this server certificate in the ‘Trusted People’ store and it was not available there. When I copied it there, the problem got resolved !