Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C52C199A7 for ; Wed, 13 Jun 2012 13:11:20 +0000 (UTC) Received: (qmail 68865 invoked by uid 500); 13 Jun 2012 13:11:20 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 68812 invoked by uid 500); 13 Jun 2012 13:11:20 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 68805 invoked by uid 99); 13 Jun 2012 13:11:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 13:11:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 13:11:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3AE4A2388847; Wed, 13 Jun 2012 13:10:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1349825 - in /cxf/trunk/services/sts: sts-core/src/main/java/org/apache/cxf/sts/operation/ sts-war/src/main/webapp/WEB-INF/ systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/ systests/basic/src/test/resources/org/apache/cxf... Date: Wed, 13 Jun 2012 13:10:54 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120613131055.3AE4A2388847@eris.apache.org> Author: coheigea Date: Wed Jun 13 13:10:54 2012 New Revision: 1349825 URL: http://svn.apache.org/viewvc?rev=1349825&view=rev Log: [CXF-4376] - STS encryptIssuedToken with the SymmetricKey KeyType does not work Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/cxf-encrypted-ut.xml cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java (original) +++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java Wed Jun 13 13:10:54 2012 @@ -306,8 +306,7 @@ public class TokenIssueOperation extends } /** - * Construct a token containing the secret to return to the client. If encryptIssuedToken is set - * then the token is wrapped in an EncryptedKey DOM element, otherwise it is returned in a + * Construct a token containing the secret to return to the client. The secret is returned in a * BinarySecretType JAXBElement. */ private Object constructSecretToken( @@ -315,17 +314,17 @@ public class TokenIssueOperation extends EncryptionProperties encryptionProperties, KeyRequirements keyRequirements ) throws WSSecurityException { - if (encryptIssuedToken) { + /*if (encryptIssuedToken) { return encryptSecret(secret, encryptionProperties, keyRequirements); } else { - BinarySecretType binarySecretType = QNameConstants.WS_TRUST_FACTORY.createBinarySecretType(); - String nonce = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce"; - binarySecretType.setType(nonce); - binarySecretType.setValue(secret); - JAXBElement binarySecret = + */ + BinarySecretType binarySecretType = QNameConstants.WS_TRUST_FACTORY.createBinarySecretType(); + String nonce = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce"; + binarySecretType.setType(nonce); + binarySecretType.setValue(secret); + JAXBElement binarySecret = QNameConstants.WS_TRUST_FACTORY.createBinarySecret(binarySecretType); - return binarySecret; - } + return binarySecret; } } Modified: cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/cxf-encrypted-ut.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/cxf-encrypted-ut.xml?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/cxf-encrypted-ut.xml (original) +++ cxf/trunk/services/sts/sts-war/src/main/webapp/WEB-INF/cxf-encrypted-ut.xml Wed Jun 13 13:10:54 2012 @@ -51,7 +51,7 @@ - http://localhost:(\d)*/doubleit/services/doubleitasymmetricsaml1encrypted + http://localhost:(\d)*/doubleit/services/doubleit(a)?symmetricsaml1encrypted Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java (original) +++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java Wed Jun 13 13:10:54 2012 @@ -130,6 +130,32 @@ public class SymmetricBindingTest extend bus.shutdown(true); } + + // TODO Re-enable this when we pick up WSS4J 1.6.7 + @org.junit.Test + @org.junit.Ignore + public void testUsernameTokenSAML1Encrypted() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = SymmetricBindingTest.class.getResource("cxf-client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = SymmetricBindingTest.class.getResource("DoubleIt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML1EncryptedPort"); + DoubleItPortType symmetricSaml1Port = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(symmetricSaml1Port, PORT); + if (standalone) { + TokenTestUtils.updateSTSPort((BindingProvider)symmetricSaml1Port, STSPORT2); + } + + doubleIt(symmetricSaml1Port, 25); + + bus.shutdown(true); + } private static void doubleIt(DoubleItPortType port, int numToDouble) { int resp = port.doubleIt(numToDouble); Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml (original) +++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml Wed Jun 13 13:10:54 2012 @@ -53,7 +53,7 @@ - http://localhost:(\d)*/doubleit/services/doubleitasymmetricsaml1encrypted + http://localhost:(\d)*/doubleit/services/doubleit(a)?symmetricsaml1encrypted Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl (original) +++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl Wed Jun 13 13:10:54 2012 @@ -70,6 +70,10 @@ + + + Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml (original) +++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml Wed Jun 13 13:10:54 2012 @@ -89,5 +89,32 @@ http://cxf.apache.org/configuration/secu + + + + + + + + + + + + + + + + + + + + + + Modified: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml?rev=1349825&r1=1349824&r2=1349825&view=diff ============================================================================== --- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml (original) +++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml Wed Jun 13 13:10:54 2012 @@ -71,5 +71,21 @@ + + + + + + + + +