One Star

Talend DI tESBConsumer Username Token error - "No username available"

When using tESBConsumer with 'Use Authentication' and 'Username Token' as the option, we are seeing the following error. Please help with details of any additional configurations required for this component. We are using Talend Open Studio DI version 5.5.1.
Exception in component tESBConsumer_1
org.apache.cxf.interceptor.Fault: No username available
    at org.apache.cxf.ws.security.wss4j.policyhandlers.TransportBindingHandler.handleBinding(TransportBindingHandler.java:163)
    at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:170)
    at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:90)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
    at ...
Caused by: org.apache.cxf.ws.policy.PolicyException: No username available
    at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.policyNotAsserted(AbstractBindingBuilder.java:313)
    at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.addUsernameToken(AbstractBindingBuilder.java:829)
    at org.apache.cxf.ws.security.wss4j.policyhandlers.TransportBindingHandler.addSignedSupportingTokens(TransportBindingHandler.java:98)
    at org.apache.cxf.ws.security.wss4j.policyhandlers.TransportBindingHandler.handleNonEndorsingSupportingTokens(TransportBindingHandler.java:181)
    at org.apache.cxf.ws.security.wss4j.policyhandlers.TransportBindingHandler.handleBinding(TransportBindingHandler.java:151)
    ... 14 more
11 REPLIES
Moderator

Re: Talend DI tESBConsumer Username Token error - "No username available"

Hi,
Please have a look at a jira issue: https://jira.talendforge.org/browse/TESB-12223
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Talend DI tESBConsumer Username Token error - "No username available"

Hi Sabrina,
Thanks for your response. But, I didn't understand how the issues discussed in the link has any connection to my use case. I am setting the username and password values in the fields provided for the 'Username Token' option.
Thanks,
Sudha
One Star

Re: Talend DI tESBConsumer Username Token error - "No username available"

Hi Sabrina,
I agree with sballa the link you mentioned talks about the error when the username and password are not mentioned and authentication method  is selected. I am facing the similar issue mentioned by sballa. I think talend tesbconsumer does not support the authentication where in the WSDL you are using has a WS-SecucurityPolicy fragment in it that describes the UsernameToken policy. In this case WSS4JOutInterceptor should not be configured but Talend component does it by default. I am pasting the relevant links here. 

Our web service works fine with soap-ui and when tried with Talend ESB Consumer it fails consistently with the correct credentials, error is same as mentioned in the stackoverflow link above.
org.apache.cxf.interceptor.Fault: No username available
 at org.apache.cxf.ws.security.wss4j.policyhandlers.TransportBindingHandler.handleBinding(TransportBindingHandler.java:161)
 at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:170)
 at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:90)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
 at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:350)
 at nab_121_merge_ccw.nra_0_1.nra$GenericConsumer.invoke(nra.java:623)
 at nab_121_merge_ccw.nra_0_1.nra.tFixedFlowInput_1Process(nra.java:1479)
 at nab_121_merge_ccw.nra_0_1.nra.runJobInTOS(nra.java:1989)
 at nab_121_merge_ccw.nra_0_1.nra.main(nra.java:1854)
Moderator

Re: Talend DI tESBConsumer Username Token error - "No username available"

Hi,
Would you mind opening a work item jira issue of ESB project on Talend Bug Tracker? Our ESB developer will check it.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Talend DI tESBConsumer Username Token error - "No username available"

Hi Sabrina,
I have created https://jira.talendforge.org/browse/TDI-30985 . Please do the needful. Thanks for the help.
Thanks,
Sudha
Moderator

Re: Talend DI tESBConsumer Username Token error - "No username available"

HI,
This issue is assigned to ESB team.
https://jira.talendforge.org/browse/TESB-14454
We'll keep you posted if there is any solution. Feel free to communicate with our ESB developer in this jira issue if you have any question on it.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: Talend DI tESBConsumer Username Token error - "No username available"

HI,
This issue is assigned to ESB team.

We'll keep you posted if there is any solution. Feel free to communicate with our ESB developer in this jira issue if you have any question on it.

Best regards
Sabrina

Hi xdshi. 
I am getting the same error than sballa and the assigned  issue  was not solved. 
I need your help please. any suggestion?
One Star

Re: Talend DI tESBConsumer Username Token error - "No username available"

One Star

Re: Talend DI tESBConsumer Username Token error - "No username available"

Using job exported to Runtime call was successful:
---------------------------
ID: 1
Address: https://secure.p03.eloqua.com/API/1.2/Service.svc
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml
Headers: {Accept=, SOAPAction=}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsseSmiley Frustratedecurity soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-2bf3cea0-9b12-4c2a-b5b0-0cd2de48fdeb"><wsse:Username>username</wsse:Username><wsseSmiley Tongueassword Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsseSmiley Tongueassword></wsse:UsernameToken></wsseSmiley Frustratedecurity></soap:Header><soap:Body><tns:ListEntityTypes xmlns:tns="https://secure.eloqua.com/API/1.2"/></soap:Body></soap:Envelope>
--------------------------------------
----------------------------
ID: 1
Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Cache-Control=, connection=, Content-Length=, content-type=, Date=, P3P=}
Payload: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">The company, user name or password you have entered is incorrect.</faultstring></s:Fault></s:Body></s:Envelope>
--------------------------------------
One Star

Re: Talend DI tESBConsumer Username Token error - "No username available"

Some words about run the client inside the Studio: there is manual interceptor configuration for Usernamr Token used and lloks like this method failed in case policy is part of wsdl definition.

Re: Talend DI tESBConsumer Username Token error - "No username available"

How to solve this issue? Since i'm using live WSDL. I cannot change the definition.