如何使用WCF签署X509令牌

前端之家收集整理的这篇文章主要介绍了如何使用WCF签署X509令牌前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在开发一个必须与Oracle WebLogic服务通信的WCF客户端.该服务强制执行相互证书身份验证.

但是,我们无法满足策略,并且服务器会记录错误说明:

“WSM-00081: The X.509 certificate is not signed.”

我一直想知道这是什么意思. Oracle文档说明:

WSM-00081: The X.509 certificate is not signed.

Cause: The X509 token used was not signed according to requirements of certificate authentication scenario.

Action: Sign the X509 token (depending upon the reference mechanism used) for certificate authentication.

Level: 1

Type: ERROR

Impact: Security

(http://docs.oracle.com/cd/E25054_01/core.1111/e10113/chapter_wsm_messages.htm)

经过一些研究,我们发现我们可以通过设置is-signed =“false来禁用服务策略配置文件中的检查:

<orasp:x509-token orasp:enc-key-ref-mech="direct" orasp:is-encrypted="false"
              orasp:is-signed="false"
              orasp:rcpt-enc-key-ref-mech="direct"
              orasp:rcpt-sign-key-ref-mech="direct"
              orasp:sign-key-ref-mech="direct"/>

我的两个理论:

>证书需要由CA签名

>我们使用CA签署的证书进行了检查,但这没有任何区别
>但是,在配置时我们可能会犯下som错误.我们应该尝试一下吗?

>我们需要签署包含在请求中的包含的BinarySecurityToken.

>但是,我不知道我怎么能这样做

我是否完全误解了这个主题,或者你们中的任何人都可以指出问题可能是什么以及如何解决

解决方法

您需要在安全令牌中签名作为请求的一部分.

在配置的绑定元素中,将安全元素模式设置为SecurityMode.Message,将消息元素clientCredentialType设置为MessageCredentialType.Certificate

<security mode="Message">
    <message clientCredentialType="Certificate"
        algorithmSuite="Default"
        establishSecurityContext="true" />
</security>

接下来,创建端点行为以解析client certificate的位置:

<behavior name="endpointCredentialBehavior">
    <clientCredentials>
        <clientCertificate findValue="Contoso.com" 
            storeLocation="LocalMachine"
            storeName="TrustedPeople"
            x509FindType="FindBySubjectName" />
    </clientCredentials>
</behavior>
原文链接:https://www.f2er.com/html/225634.html

猜你在找的HTML相关文章