You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by kishore_897 <ki...@yahoo.com> on 2011/07/28 22:55:31 UTC
Re: Sample STS Client
I am getting the following exception
java.lang.NullPointerException
at
org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:335)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:408)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:403)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:395)
Here is my sts bean configuration
<bean id="stsClient" class="org.apache.cxf.ws.security.trust.STSClient" >
<constructor-arg ref="cxf" />
<property name="requiresEntropy" value="false" />
<property name="wsdlLocation"
value="https://localhost:9443/services/wso2carbon-sts?wsdl" />
<property name="serviceName"
value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512}SecurityTokenService"
/>
<property name="endpointName"
value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityToken"
/>
<property name="properties">
<map>
<entry key="ws-security.username" value="testuser" />
<entry key="ws-security.password" value="testuser" />
<entry key="ws-security.signature.properties"
value="E:\Software\tools\wso2\wso2is-3.0.1\resources\security\wso2carbon.jks"/>
<entry key="ws-security.encryption.properties"
value="E:\Software\tools\wso2\wso2is-3.0.1\resources\security\wso2carbon.jks"/>
<entry key="ws-security.signature.username" value="localhost"/>
<entry key="ws-security.encryption.username" value="localhost"/>
</map>
</property>
</bean>
--
View this message in context: http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4644191.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Sample STS Client
Posted by kishore_897 <ki...@yahoo.com>.
Here is the soap request that is being sent acrross using AXIS2-RAMPART and I
was able to get the STS token succesfully. I felt we might need to set same
set of data when sending the soap request to the wso2 sts token provider.
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="true">
<wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-1">
<wsu:Created>2011-08-01T16:40:44.043Z</wsu:Created>
<wsu:Expires>2011-08-01T16:45:44.043Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="UsernameToken-2">
<wsse:Username>testuser</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">testuser</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<wsa:To>http://localhost:1443/services/wso2carbon-sts</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:D4399E13287E3814811312216843550</wsa:MessageID>
<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<wst:RequestSecurityToken
xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsa:EndpointReference
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsa:Address>http://localhost:8080/axis2/services/SecureService</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wst:Lifetime>
<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-01T16:40:43.495Z</wsu:Created>
<wsu:Expires
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-02T16:34:03.495Z</wsu:Expires>
</wst:Lifetime>
<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</wst:TokenType>
<wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</wst:KeyType>
<wsid:ClaimType xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity"
Uri="http://wso2.org/claims/userid" />
</wst:Claims></wst:RequestSecurityToken></soapenv:Body></soapenv:Envelope>
Now I need to figure out how we can set the data if we are using CXF sts
client APIs. I tried using the API requestSecurityToken(String appliesTo,
String action, String requestType,
SecurityToken target)
I am not sure how we get the Security Token upfront and what Info. I need to
set when sending the data when using the above API but when I send it as
null still I am seeing the same exception
requestSecurityToken(String appliesTo, String action, String requestType,
SecurityToken target)
[2011-08-03 14:50:27,986] ERROR - The [action] cannot be processed at the
receiver.
org.apache.axis2.AxisFault: The [action] cannot be processed at the
receiver.
at
org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFault(AddressingFaultsHelper.java:373)
at
org.apache.axis2.addressing.AddressingFaultsHelper.triggerActionNotSupportedFault(AddressingFaultsHelper.java:336)
at
org.apache.axis2.handlers.addressing.AddressingInHandler.extractActionInformation(AddressingInHandler.java:521)
at
org.apache.axis2.handlers.addressing.AddressingInHandler.extractAddressingInformation(AddressingInHandler.java:238)
at
org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:153)
at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:259)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:662)
Thanks
Kishore
--
View this message in context: http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4664175.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Sample STS Client
Posted by Daniel Kulp <dk...@apache.org>.
It LOOKS like the Axis/WSO2 wsdl is wrong (assuming you are using the stuff in
the wsdl):
<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
That's really not a valid Action. In this case, I would assume (since it
looks like an issue request for a non-WS-SecureConv case) that it should be:
<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>
I would check the WSDL to make sure the proper action is defined for the issue
operation. If you are calling the CXF STSClient directly, you can call the
requestSecurityToken(String appliesTo, String action, String requestType,
SecurityToken target)
method directly and provide the correct action there. That may be a
workaround.
Dan
On Monday, August 01, 2011 2:00:14 PM kishore_897 wrote:
> Hi
>
> I am using CXF 2.4.1. I am trying create a STS Client which can get the
> token from the STS token provider (wso2 identity server)..
>
> Below is the soap request I am expecting the CXF STS client to generate when
> it sends the token request.
>
> I am not having clear picture whether CXF STS client API has all the APIs to
> set the data.
>
> Yes the WSDL (sts service ) is available. I was able to generate the token
> with Axis2 - Rampart. But we found some HTTP Connection issues with it . So
> we were trying to achieve with CXF Stsclient.
>
> If you have any documentation / example on the APIs available to set the
> following configuration will be helpful
>
> <?xml version='1.0' encoding='UTF-8'?>
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> <soapenv:Header
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> <wsse:Security
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> ty-secext-1.0.xsd" soapenv:mustUnderstand="true">
> <wsu:Timestamp
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd" wsu:Id="Timestamp-1">
> <wsu:Created>2011-08-01T16:40:44.043Z</wsu:Created>
> <wsu:Expires>2011-08-01T16:45:44.043Z</wsu:Expires>
> </wsu:Timestamp>
> <wsse:UsernameToken
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd" wsu:Id="UsernameToken-2">
> <wsse:Username>testuser</wsse:Username>
> <wsse:Password
> Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> -profile-1.0#PasswordText">testuser</wsse:Password> </wsse:UsernameToken>
> </wsse:Security>
> <wsa:To>http://localhost:1443/services/wso2carbon-sts</wsa:To>
> <wsa:ReplyTo>
> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
> </wsa:Address> </wsa:ReplyTo>
> <wsa:MessageID>urn:uuid:D4399E13287E3814811312216843550</wsa:MessageID>
> <wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
> </soapenv:Header>
> <soapenv:Body>
> <wst:RequestSecurityToken
> xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
> <wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:Requ
> estType> <wsp:AppliesTo
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> <wsa:EndpointReference
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> <wsa:Address>http://localhost:8080/axis2/services/SecureService</wsa:Address
> > </wsa:EndpointReference>
> </wsp:AppliesTo>
> <wst:Lifetime>
> <wsu:Created
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd">2011-08-01T16:40:43.495Z</wsu:Created> <wsu:Expires
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd">2011-08-02T16:34:03.495Z</wsu:Expires> </wst:Lifetime>
> <wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1
> .1#SAMLV2.0</wst:TokenType>
> <wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</wst:
> KeyType> <wsid:ClaimType
> xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity"
> Uri="http://wso2.org/claims/userid" />
> </wst:Claims></wst:RequestSecurityToken></soapenv:Body></soapenv:Envelope>
>
>
> I have programatically created a client. I was able to send the request to
> the server but it result in exception as action element is not set
>
> 2011-08-01 10:45:05,595] ERROR - The [action] cannot be processed at the
> receiver.
> rg.apache.axis2.AxisFault: The [action] cannot be processed at the receiver.
> at
> org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFault(Ad
> dressingFaultsHelper.java:373) at
> org.apache.axis2.addressing.AddressingFaultsHelper.triggerActionNotSupported
> Fault(AddressingFaultsHelper.java:336) at
> org.apache.axis2.handlers.addressing.AddressingInHandler.extractActionInform
> ation(AddressingInHandler.java:521) at
> org.apache.axis2.handlers.addressing.AddressingInHandler.extractAddressingIn
> formation(AddressingInHandler.java:238) at
> org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingIn
> Handler.java:153) at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:259)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
> TPTransportUtils.java:173) at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(
> ServletRegistration.java:90) at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxySer
> vlet.java:111) at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.
> java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
> org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:154)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:269) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:188) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:210) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:174) at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
> ) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
> ) at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :108) at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC
> onnection(Http11BaseProtocol.java:665) at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
> a:528) at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
> rkerThread.java:81) at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:685) at java.lang.Thread.run(Thread.java:662)
>
>
> Thanks
> Kishore
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4656674.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
Re: Sample STS Client
Posted by Johan Edstrom <se...@gmail.com>.
This might be a good start : http://coheigea.blogspot.com/2011/05/ws-trust-sample-in-talend-service.html
On Aug 1, 2011, at 3:00 PM, kishore_897 wrote:
> Hi
>
> I am using CXF 2.4.1. I am trying create a STS Client which can get the
> token from the STS token provider (wso2 identity server)..
>
> Below is the soap request I am expecting the CXF STS client to generate when
> it sends the token request.
>
> I am not having clear picture whether CXF STS client API has all the APIs to
> set the data.
>
> Yes the WSDL (sts service ) is available. I was able to generate the token
> with Axis2 - Rampart. But we found some HTTP Connection issues with it . So
> we were trying to achieve with CXF Stsclient.
>
> If you have any documentation / example on the APIs available to set the
> following configuration will be helpful
>
> <?xml version='1.0' encoding='UTF-8'?>
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> <soapenv:Header
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> <wsse:Security
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> soapenv:mustUnderstand="true">
> <wsu:Timestamp
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="Timestamp-1">
> <wsu:Created>2011-08-01T16:40:44.043Z</wsu:Created>
> <wsu:Expires>2011-08-01T16:45:44.043Z</wsu:Expires>
> </wsu:Timestamp>
> <wsse:UsernameToken
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="UsernameToken-2">
> <wsse:Username>testuser</wsse:Username>
> <wsse:Password
> Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">testuser</wsse:Password>
> </wsse:UsernameToken>
> </wsse:Security>
> <wsa:To>http://localhost:1443/services/wso2carbon-sts</wsa:To>
> <wsa:ReplyTo>
> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
> </wsa:ReplyTo>
> <wsa:MessageID>urn:uuid:D4399E13287E3814811312216843550</wsa:MessageID>
> <wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
> </soapenv:Header>
> <soapenv:Body>
> <wst:RequestSecurityToken
> xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
> <wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>
> <wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
> <wsa:EndpointReference
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
> <wsa:Address>http://localhost:8080/axis2/services/SecureService</wsa:Address>
> </wsa:EndpointReference>
> </wsp:AppliesTo>
> <wst:Lifetime>
> <wsu:Created
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-01T16:40:43.495Z</wsu:Created>
> <wsu:Expires
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-02T16:34:03.495Z</wsu:Expires>
> </wst:Lifetime>
> <wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</wst:TokenType>
> <wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</wst:KeyType>
> <wsid:ClaimType xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity"
> Uri="http://wso2.org/claims/userid" />
> </wst:Claims></wst:RequestSecurityToken></soapenv:Body></soapenv:Envelope>
>
>
> I have programatically created a client. I was able to send the request to
> the server but it result in exception as action element is not set
>
> 2011-08-01 10:45:05,595] ERROR - The [action] cannot be processed at the
> receiver.
> rg.apache.axis2.AxisFault: The [action] cannot be processed at the receiver.
> at
> org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFault(AddressingFaultsHelper.java:373)
> at
> org.apache.axis2.addressing.AddressingFaultsHelper.triggerActionNotSupportedFault(AddressingFaultsHelper.java:336)
> at
> org.apache.axis2.handlers.addressing.AddressingInHandler.extractActionInformation(AddressingInHandler.java:521)
> at
> org.apache.axis2.handlers.addressing.AddressingInHandler.extractAddressingInformation(AddressingInHandler.java:238)
> at
> org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:153)
> at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:259)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
> at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:154)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> at java.lang.Thread.run(Thread.java:662)
>
>
> Thanks
> Kishore
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4656674.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: Sample STS Client
Posted by kishore_897 <ki...@yahoo.com>.
Hi
I am using CXF 2.4.1. I am trying create a STS Client which can get the
token from the STS token provider (wso2 identity server)..
Below is the soap request I am expecting the CXF STS client to generate when
it sends the token request.
I am not having clear picture whether CXF STS client API has all the APIs to
set the data.
Yes the WSDL (sts service ) is available. I was able to generate the token
with Axis2 - Rampart. But we found some HTTP Connection issues with it . So
we were trying to achieve with CXF Stsclient.
If you have any documentation / example on the APIs available to set the
following configuration will be helpful
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
soapenv:mustUnderstand="true">
<wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="Timestamp-1">
<wsu:Created>2011-08-01T16:40:44.043Z</wsu:Created>
<wsu:Expires>2011-08-01T16:45:44.043Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="UsernameToken-2">
<wsse:Username>testuser</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">testuser</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<wsa:To>http://localhost:1443/services/wso2carbon-sts</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:D4399E13287E3814811312216843550</wsa:MessageID>
<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<wst:RequestSecurityToken
xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsa:EndpointReference
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsa:Address>http://localhost:8080/axis2/services/SecureService</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wst:Lifetime>
<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-01T16:40:43.495Z</wsu:Created>
<wsu:Expires
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2011-08-02T16:34:03.495Z</wsu:Expires>
</wst:Lifetime>
<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</wst:TokenType>
<wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</wst:KeyType>
<wsid:ClaimType xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity"
Uri="http://wso2.org/claims/userid" />
</wst:Claims></wst:RequestSecurityToken></soapenv:Body></soapenv:Envelope>
I have programatically created a client. I was able to send the request to
the server but it result in exception as action element is not set
2011-08-01 10:45:05,595] ERROR - The [action] cannot be processed at the
receiver.
rg.apache.axis2.AxisFault: The [action] cannot be processed at the receiver.
at
org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFault(AddressingFaultsHelper.java:373)
at
org.apache.axis2.addressing.AddressingFaultsHelper.triggerActionNotSupportedFault(AddressingFaultsHelper.java:336)
at
org.apache.axis2.handlers.addressing.AddressingInHandler.extractActionInformation(AddressingInHandler.java:521)
at
org.apache.axis2.handlers.addressing.AddressingInHandler.extractAddressingInformation(AddressingInHandler.java:238)
at
org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:153)
at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:259)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:662)
Thanks
Kishore
--
View this message in context: http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4656674.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Sample STS Client
Posted by Colm O hEigeartaigh <co...@apache.org>.
What version of CXF are you using? Are you sure the WSDL is resolvable
at the address you have specified?
Colm.
On Thu, Jul 28, 2011 at 9:55 PM, kishore_897 <ki...@yahoo.com> wrote:
> I am getting the following exception
>
> java.lang.NullPointerException
> at
> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:335)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:408)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:403)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:395)
>
>
> Here is my sts bean configuration
>
> <bean id="stsClient" class="org.apache.cxf.ws.security.trust.STSClient" >
> <constructor-arg ref="cxf" />
> <property name="requiresEntropy" value="false" />
> <property name="wsdlLocation"
> value="https://localhost:9443/services/wso2carbon-sts?wsdl" />
> <property name="serviceName"
> value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512}SecurityTokenService"
> />
> <property name="endpointName"
> value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityToken"
> />
> <property name="properties">
> <map>
> <entry key="ws-security.username" value="testuser" />
> <entry key="ws-security.password" value="testuser" />
> <entry key="ws-security.signature.properties"
> value="E:\Software\tools\wso2\wso2is-3.0.1\resources\security\wso2carbon.jks"/>
> <entry key="ws-security.encryption.properties"
> value="E:\Software\tools\wso2\wso2is-3.0.1\resources\security\wso2carbon.jks"/>
> <entry key="ws-security.signature.username" value="localhost"/>
> <entry key="ws-security.encryption.username" value="localhost"/>
> </map>
> </property>
> </bean>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4644191.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Colm O hEigeartaigh
http://coheigea.blogspot.com/
Talend - http://www.talend.com
Re: Sample STS Client
Posted by Glen Mazza <gm...@talend.com>.
Perhaps my blog entry will help you pinpoint the problem:
http://www.jroller.com/gmazza/entry/cxf_stsclient_metro_sts
Glen
On 07/28/2011 04:55 PM, kishore_897 wrote:
> I am getting the following exception
>
> java.lang.NullPointerException
> at
> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:335)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:408)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:403)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:395)
>
>
> Here is my sts bean configuration
>
> <bean id="stsClient" class="org.apache.cxf.ws.security.trust.STSClient">
> <constructor-arg ref="cxf" />
> <property name="requiresEntropy" value="false" />
> <property name="wsdlLocation"
> value="https://localhost:9443/services/wso2carbon-sts?wsdl" />
> <property name="serviceName"
> value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512}SecurityTokenService"
> />
> <property name="endpointName"
> value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityToken"
> />
> <property name="properties">
> <map>
> <entry key="ws-security.username" value="testuser" />
> <entry key="ws-security.password" value="testuser" />
> <entry key="ws-security.signature.properties"
> value="E:\Software\tools\wso2\wso2is-3.0.1\resources\security\wso2carbon.jks"/>
> <entry key="ws-security.encryption.properties"
> value="E:\Software\tools\wso2\wso2is-3.0.1\resources\security\wso2carbon.jks"/>
> <entry key="ws-security.signature.username" value="localhost"/>
> <entry key="ws-security.encryption.username" value="localhost"/>
> </map>
> </property>
> </bean>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4644191.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Application Integration Division
Talend (http://www.talend.com/ai)
blog: http://www.jroller.com/gmazza