【问题标题】:CXF STS Usernametoken symmetric binding XML Signature verification has failedCXF STS Usernametoken 对称绑定 XML 签名验证失败
【发布时间】:2014-07-13 14:57:10
【问题描述】:

使用 CXF STS-STS 客户端示例我遵循了https://web-gmazza.rhcloud.com/blog/entry/cxf-sts-tutorial 的示例,我的示例代码位于https://github.com/sampleref/CXFSecurity 以供参考。在调试时,我在 STS 提供商处发现如下错误

    <<||2014-07-13 18:26:50,286||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.processor.UsernameTokenProcessor:50||||>> Found UsernameToken list element 
<<||2014-07-13 18:26:50,287||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.validate.UsernameTokenValidator:78||||>> UsernameToken user alice 
<<||2014-07-13 18:26:50,287||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.validate.UsernameTokenValidator:79||||>> UsernameToken password type http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText 
<<||2014-07-13 18:26:50,287||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.processor.SignatureProcessor:115||||>> Found signature element 
<<||2014-07-13 18:26:50,288||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.processor.SignatureProcessor:380||||>> Verify XML Signature 
<<||2014-07-13 18:26:50,292||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.processor.SignatureProcessor:428||||>> XML Signature verification has failed 
<<||2014-07-13 18:26:50,292||http-apr-8080-exec-3|DEBUG|org.apache.ws.security.processor.SignatureProcessor:431||||>> Signature Validation check: false 

请提供一些意见,这对我来说真的很重要。我在 STS 客户端发布了更详细的错误 CXF STS client throws Request does not contain Security header/Response message does not contain WS-Addressing properties

【问题讨论】:

    标签: spring cxf ws-security saml-2.0 ws-trust


    【解决方案1】:

    问题是您没有在 STS 中提供私钥的密码。因此,例如,将以下内容添加到 StsPasswordCallbackHandler 使解密工作:

    x509Passwords.put("stskeyalias", "stskeypassword");

    您还需要从 STS pom 中删除 BouncyCastle 依赖项。

    科尔姆。

    【讨论】:

    • 您好科尔姆,感谢您的回复。我根据建议修改了 [github.com/sampleref/CXFSecurity] 的示例,但我仍然面临与&lt;&lt;||2014-07-14 21:51:14,125||http-apr-8080-exec-8|DEBUG|org.apache.ws.security.processor.SignatureProcessor:428||||&gt;&gt; XML Signature verification has failed &lt;&lt;||2014-07-14 21:51:14,127||http-apr-8080-exec-8|DEBUG|org.apache.ws.security.processor.SignatureProcessor:431||||&gt;&gt; Signature Validation check: false 相同的错误
    • 我有完整的密钥生成脚本github.com/sampleref/CXFSecurity/blob/master/CheckService/src/…。我无法弄清楚是什么导致了这个错误。您能否建议一些可能导致此错误的关键区域。客户端的日志显示WARNING: Response message does not contain WS-Addressing properties. Not correlating responseJul 14, 2014 10:16:43 PM org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor handleMessage WARNING: Request does not contain Security header, but it's a fault.
    • 嗨 Colm,我在 issues.apache.org/jira/browse/CXF-5679issues.apache.org/jira/browse/CXF-5724 看到了类似的问题。正如它所说的问题已在 3.0.0 中解决,我尝试使用 3.0.0。现在在启动时我收到错误Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http. 不确定如何继续。请提供一些意见
    【解决方案2】:

    我认为问题,https://issues.apache.org/jira/browse/CXF-5679https://issues.apache.org/jira/browse/CXF-5724 正在制造问题。我使用了 CXF 3.0.0 版,现在能够获得 SAML 断言

    谢谢

    【讨论】:

      猜你喜欢
      • 2021-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-28
      • 2013-10-28
      • 2020-11-02
      相关资源
      最近更新 更多