Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7536

STRTransform TransformException when manually adding SAML Assertion via SAMLCallback.setAssertionElement()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.1.14, 3.2.1
    • None
    • Apache Tomcat 8.0.37

    • Unknown

    Description

      In Apache CXF v3.1.7, I have a JAX-WS web service client calling a service that requires a HolderOfKey SAML Assertion. The assertions are from a custom service that does not adhere to the WS-Trust SecureTokenService standard, so I am adding them manually in a SAMLCallbackHander, using the callback.setAssertionElement() method.

      When invoking the client, the WSS4J framework is unable to compute the signature for the SecurityTokenReference header block, throwing the below error:

      {{
      javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: org.apache.wss4j.common.ext.WSSecurityException: Referenced token "id-of-SAML-assertion" not found
      at org.apache.wss4j.dom.str.STRParserUtil.getTokenElement(StrParserUtil.java:314)
      at org.apache.wss4j.dom.transform.STRTransformUtil.dereferenceSTR(STRTransformUtil.java:98)
      at org.apache.wss4j.dom.transform.STRTransform.transformIt(STRTransform.java:195)}}

      It appears that the SAML assertion DOM Element that is added via the callback.setAssertionElement() method is not getting searched by the STRParserUtil.getTokenElement() method.

      Attachments

        1. service-client.war
          28.54 MB
          Russell Orf
        2. catalina.out
          4.12 MB
          Russell Orf

        Activity

          People

            coheigea Colm O hEigeartaigh
            rorf Russell Orf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: