Project: talendesb
Issue TESB-6439: STS fails to serve SAML requests from consumer
In nightly tests we are faced that a lot of tests which use SAML are fail. Appears, that consumer cannot pass communication with STS. In consumer's log there is only exception: I prepared small project-example to show what exactly happens (attached to this bug). Example is maven project which contains: {panel} 1) spring configuration with defined consumer endpoint 2) class which starts this spring config (tesb.test.example.cxf/src/main/java/org/talend/esb/test/services/clients/SpringClient.java) 3) wsdl for service 4) codegeneration plugin for this wsdl. 5) required security configuration stuff. {panel} Steps for reproduce: {panel} 1) Unpack fresh container 2) Unpack and build (mvn clean install) example project 3) copy content (policy and keystores) of tesb.test.example.cxf/etc/ into /etc/ 4) start container 5) add jaas user and role (jaas:manage --realm karaf; jaas:useradd qa_hasi qa_hasi; jaas:roleadd qa_hasi admin; jaas:update) 6) install sts (features:install tesb-sts) 7) configure sts-client (config:edit org.talend.esb.job.client.sts; config:propset sts.wsdl.location http://infrastructure:8040/services/SecurityTokenService/UT?wsdl; config:update; features:uninstall talend-job-controller; features:install talend-job-controller;) 8) run SpringClient class from eclipse (-Dlog4j.configuration=log4j.properties) {panel} After execution doRequestResponse it will throw exception: {noformat} javax.xml.ws.soap.SOAPFaultException: The specified request failed at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) at $Proxy44.doRequestResponse(Unknown Source) at org.talend.esb.test.services.clients.SpringClient.main(SpringClient.java:51) Caused by: org.apache.cxf.binding.soap.SoapFault: The specified request failed at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1656) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1521) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1429) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:659) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:722) at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:602) at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:594) at org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:590) at org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptorProvider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvider.java:401) at org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptorProvider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider.java:188) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) {noformat} on STS's side there is an exception: {noformat} 02:40:48,114 | WARN | qtp31642573-104 | ts.operation.TokenIssueOperation 147 | 200 - org.apache.cxf.services.sts.core - 2.6.1 | org.apache.cxf.ws.security.sts.provider.STSException: The specified request failed at org.apache.cxf.sts.token.provider.SAMLTokenProvider.createToken(SAMLTokenProvider.java:205)[200:org.apache.cxf.services.sts.core:2.6.1] at org.apache.cxf.sts.operation.TokenIssueOperation.issueSingle(TokenIssueOperation.java:145)[200:org.apache.cxf.services.sts.core:2.6.1] at org.apache.cxf.sts.operation.TokenIssueOperation.issue(TokenIssueOperation.java:70)[200:org.apache.cxf.services.sts.core:2.6.1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_30] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_30] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_30] at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_30] .................... Caused by: java.lang.IllegalArgumentException: InputStream cannot be null at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:120)[:1.6.0_30] at org.opensaml.xml.parse.BasicParserPool$DocumentBuilderProxy.parse(BasicParserPool.java:671) at org.opensaml.xml.parse.BasicParserPool.parse(BasicParserPool.java:215) at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:141)[144:org.apache.servicemix.bundles.opensaml:2.5.1.2] at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:199)[144:org.apache.servicemix.bundles.opensaml:2.5.1.2] at org.apache.ws.security.saml.ext.OpenSAMLBootstrap.bootstrap(OpenSAMLBootstrap.java:77)[150:org.apache.ws.security.wss4j:1.6.6] at org.apache.ws.security.saml.ext.OpenSAMLUtil.initSamlEngine(OpenSAMLUtil.java:61)[150:org.apache.ws.security.wss4j:1.6.6] at org.apache.ws.security.saml.ext.AssertionWrapper.(AssertionWrapper.java:214)[150:org.apache.ws.security.wss4j:1.6.6] at org.apache.cxf.sts.token.provider.SAMLTokenProvider.createSamlToken(SAMLTokenProvider.java:328)[200:org.apache.cxf.services.sts.core:2.6.1] at org.apache.cxf.sts.token.provider.SAMLTokenProvider.createToken(SAMLTokenProvider.java:126)[200:org.apache.cxf.services.sts.core:2.6.1] ... 58 more {noformat}
Story points: 1