Hi Farasath, attached the java client class. Regards, Jorge.
2017-04-30 16:20 GMT-04:00, Farasath Ahamed <farasa...@wso2.com>: > Farasath Ahamed > Software Engineer, WSO2 Inc.; http://wso2.com > Mobile: +94777603866 > Blog: blog.farazath.com > Twitter: @farazath619 <https://twitter.com/farazath619> > <http://wso2.com/signature> > > > > On Fri, Apr 28, 2017 at 7:17 PM, Jorge <isildur...@gmail.com> wrote: > >> Hi folks.. >> >> With a sample code I'm testing the STS scenario with this configurations: >> >> 1. WSO2 IS STS service secured with UT policy. >> 2. JAVA client requesting a saml token to the WSO2 IS to include it >> inside >> the call to the proxy service in ESB. >> >> >> My maven dependencies version: >> >> <properties> >> <wss4j.wso2.version>1.5.11.wso2v16</wss4j.wso2.version> >> <axis2.client.version>1.6.1.wso2v5</axis2.client.version> >> <junit.version>3.8.1</junit.version> >> <rampart.wso2.version>1.6.1.wso2v8</rampart.wso2.version> >> >> <org.apache.rampart-trust.version>1.6.1.wso2v12</org.apache.rampart-trust.version> >> <axiom.wso2.version>1.2.11.wso2v1</axiom.wso2.version> >> <version.commons.logging>1.1.1</version.commons.logging> >> <httpcore.wso2.version>4.3.3.wso2v1</httpcore.wso2.version> >> <axis2.wso2.version>1.6.1.wso2v4</axis2.wso2.version> >> <opensaml.wso2.version>2.0.0.alpha1-wso2v1</opensaml.wso2.version> >> </properties> >> >> >> I'm getting an error in this line in rampart-core library: >> >> elem = RampartUtil.insertSiblingAfter(rmd, this.getInsertionLocation(), >> (Element)endSuppTok.getToken()); >> >> > > *(Element)endSuppTok.getToken() *this casting seem to be the problem. > Would you be able to share your Java client source code? > > >> The error: >> >> java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMElementImpl >> cannot be cast to org.w3c.dom.Element >> at org.apache.rampart.builder.BindingBuilder.handleSupportingTokens( >> BindingBuilder.java:388) >> at >> org.apache.rampart.builder.SymmetricBindingBuilder.doSignBeforeEncrypt( >> SymmetricBindingBuilder.java:499) >> at org.apache.rampart.builder.SymmetricBindingBuilder.build( >> SymmetricBindingBuilder.java:86) >> at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:144) >> at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65) >> at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340) >> at org.apache.axis2.engine.Phase.invoke(Phase.java:313) >> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262) >> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:427) >> at org.apache.axis2.description.OutInAxisOperationClient.send( >> OutInAxisOperation.java:406) >> at org.apache.axis2.description.OutInAxisOperationClient.executeImpl( >> OutInAxisOperation.java:229) >> at org.apache.axis2.client.OperationClient.execute( >> OperationClient.java:165) >> at org.apache.axis2.client.ServiceClient.sendReceive( >> ServiceClient.java:555) >> at org.apache.axis2.client.ServiceClient.sendReceive( >> ServiceClient.java:531) >> at org.wso2.carbon.identity.samples.sts.Client.run(Client.java:258) >> at org.wso2.carbon.identity.samples.sts.Client.main(Client.java:106) >> >> >> > The saml token is this: >> >> <saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" >> ID="urn:uuid:B245D8BE51DD76D8C11493317175833" >> IssueInstant="2017-04-27T18:19:35.830Z" >> Version="2.0"> >> <saml2:Issuer>https://localhost</saml2:Issuer> >> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> >> <ds:SignedInfo> >> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/ >> 2001/10/xml-exc-c14n#" /> >> <ds:SignatureMethod >> Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" >> /> >> <ds:Reference URI="#urn:uuid:B245D8BE51DD76D8C11493317175833"> >> <ds:Transforms> >> <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped- >> signature" /> >> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> >> </ds:Transforms> >> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> >> <ds:DigestValue>kRCUeY8ciMqYIw4DiKjihd/TzkM=</ds:DigestValue> >> </ds:Reference> >> </ds:SignedInfo> >> <ds:SignatureValue> >> WVVU74daKAuwH1lbF/DP78odPJShvVhMsKK8e207QVLUwNsX >> t12MT1OEmwg5WOkDABvn2LfwFuzY >> 46usFhAF2W6frqJgyrQttddF2ue09D8/2aGGQ1S3MkYOb6zIBlj7WR4nbnMFeX >> rRBhhrrPjn2p+A >> NHUTjwjfTP+JKIZWE7I= >> </ds:SignatureValue> >> <ds:KeyInfo> >> <ds:X509Data> >> <ds:X509Certificate>MIICNTCCAZ6gAwIBAgIES343gjANBg >> kqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJVUzELMAkGA1UE >> CAwCQ0ExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxDTALBgNVBAoMBFdTTzIx >> EjAQBgNVBAMMCWxv >> Y2FsaG9zdDAeFw0xMDAyMTkwNzAyMjZaFw0zNTAyMTMwNzAyMjZaMFUxCzAJ >> BgNVBAYTAlVTMQsw >> CQYDVQQIDAJDQTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzENMAsGA1UECgwE >> V1NPMjESMBAGA1UE >> AwwJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCUp/ >> oV1vWc8/TkQSiAvTou >> sMzOM4asB2iltr2QKozni5aVFu818MpOLZIr8LMnTzWllJvvaA5RAAdpbECb >> +48FjbBe0hseUdN5 >> HpwvnH/DW8ZccGvk53I6Orq7hLCv1ZHtuOCokghz/ATrhyPq+ >> QktMfXnRS4HrKGJTzxaCcU7OQID >> AQABoxIwEDAOBgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADgYEAW5wP >> R7cr1LAdq+IrR44i >> QlRG5ITCZXY9hI0PygLP2rHANh+PYfTmxbuOnykNGyhM6FjFLbW2uZHQT >> Y1jMrPprjOrmyK5sjJR >> O4d1DeGHT/YnIjs9JogRKv4XHECwLtIVdAbIdWHEtVZJyMSktcyysFcvuhPQK8Qc/E/ >> Wq8uHSCo=</ds:X509Certificate> >> </ds:X509Data> >> </ds:KeyInfo> >> </ds:Signature> >> <saml2:Subject> >> <saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format: >> emailAddress">admin</saml2:NameID> >> <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer" >> /> >> </saml2:Subject> >> <saml2:Conditions NotBefore="2017-04-27T18:19:37.908Z" >> NotOnOrAfter="2017-04-27T18:24:37.908Z" /> >> <saml2:AuthnStatement AuthnInstant="2017-04-27T18:19:35.838Z"> >> <saml2:AuthnContext> >> <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0: >> ac:classes:Password</saml2:AuthnContextClassRef> >> </saml2:AuthnContext> >> </saml2:AuthnStatement> >> </saml2:Assertion> >> >> >> Any idea? >> > >> > >> >> >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> >
Client.java
Description: Binary data
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev