Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1191862

Summary: (6.2.0) WSS UsernameToken fails to propagate at SOAP reference binding with WSS Policy
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Tadayoshi Sato <tasato>
Component: SwitchYardAssignee: Aileen <aileenc>
Status: CLOSED UPSTREAM QA Contact: Matej Melko <mmelko>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0 GACC: kejohnso, ldimaggi, soa-p-jira, tcunning
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1191864 (view as bug list) Environment:
Last Closed: 2025-02-10 03:44:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1191864    
Attachments:
Description Flags
Reproducer (camel-soap-proxy.zip) none

Description Tadayoshi Sato 2015-02-12 07:17:35 UTC
Created attachment 990753 [details]
Reproducer (camel-soap-proxy.zip)

Description of problem:

Platform BZ for https://issues.jboss.org/browse/SWITCHYARD-2520

SOAPContextMapper's soapHeadersType attribute (SWITCHYARD-710) allows you to propagate WS-Security SOAP headers from a SOAP service binding to a SOAP reference binding:

  <contextMapper includes=".*" soapHeadersType="XML"/>

However, when the reference binding is defined with WSDL that has a WS-Security Policy portion like the following one:

  <binding name="ReverseServiceBinding" type="tns:ReverseService">
    <wsp:PolicyReference URI="#ReverseServicePolicy"/>
    ...
  </binding>
  <wsp:Policy wsu:Id="ReverseServicePolicy">
    <wsp:ExactlyOne>
      <wsp:All>
        <sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
          <wsp:Policy>
            <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
              <wsp:Policy>
                <sp:WssUsernameToken10/>
              </wsp:Policy>
            </sp:UsernameToken>
          </wsp:Policy>
        </sp:SupportingTokens>
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>

the reference fails to send a SOAP request raising the following warning:

15:01:40,139 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (http-/127.0.0.1:8080-1) Interceptor for {urn:switchyard-quickstart:camel-soap-proxy:1.0}ReverseService#{http://cxf.apache.org/jaxws/dispatch}Invoke has thrown exception, unwinding now: org.apache.cxf.ws.policy.PolicyException: No username available
	at org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.policyNotAsserted(AbstractTokenInterceptor.java:229) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
	at org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor.addUsernameToken(UsernameTokenInterceptor.java:361) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
	at org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor.addToken(UsernameTokenInterceptor.java:307) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
	at org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.handleMessage(AbstractTokenInterceptor.java:95) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]
	at org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.handleMessage(AbstractTokenInterceptor.java:61) [cxf-rt-ws-security-2.7.11.redhat-3.jar:2.7.11.redhat-3]


Version-Release number of selected component (if applicable):
N/A


How reproducible:
Always


Steps to Reproduce:
1. Deploy the attached quickstart (reproducer)
2. Run `mvn exec:java`


Actual results:
Get the above warning and the process fails.


Expected results:
The process should complete successfully.


Additional info:
N/A

Comment 1 JBoss JIRA Server 2015-04-10 04:32:01 UTC
Tadayoshi Sato <tadayosi> updated the status of jira SWITCHYARD-2520 to Resolved

Comment 2 Tadayoshi Sato 2015-04-10 04:38:17 UTC
Moved it to 'MODIFIED' as there is a solution for the issue. See:
https://issues.jboss.org/browse/SWITCHYARD-2520?focusedCommentId=13055739&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13055739

Please QA it to make sure it can really be resolved in FSW 6.2. Thanks.

Comment 6 Red Hat Bugzilla 2025-02-10 03:44:03 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.