cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating JWE/JWS filters to postponse setting a jose media type
Date Tue, 11 Nov 2014 16:39:31 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 8fccdd91d -> 6e0451e28


Updating JWE/JWS filters to postponse setting a jose media type


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6e0451e2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6e0451e2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6e0451e2

Branch: refs/heads/master
Commit: 6e0451e28c02dbb61f11026f2bf6f29e67cdc5c4
Parents: 8fccdd9
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Nov 11 16:38:52 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Nov 11 16:38:52 2014 +0000

----------------------------------------------------------------------
 .../jose/jaxrs/JweWriterInterceptor.java        | 22 +++---
 .../jose/jaxrs/JwsWriterInterceptor.java        |  7 +-
 systests/rs-security/pom.xml                    |  5 ++
 .../jaxrs/security/jwt/JAXRSJweJwsTest.java     | 73 ++++++++++++++-----
 .../jaxrs/security/jwt/JAXRSJwsJsonTest.java    | 76 +++++++++++++++++---
 .../cxf/systest/jaxrs/security/jwt/server.xml   |  4 ++
 .../jaxrs/security/jwt/serverJwsJson.xml        | 20 ++++++
 7 files changed, 173 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java
index 73a749b..cbe4aef 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java
@@ -63,18 +63,15 @@ public class JweWriterInterceptor implements WriterInterceptor {
         JweEncryptionProvider theEncryptionProvider = getInitializedEncryptionProvider();
         
         String ctString = null;
-        if (contentTypeRequired) {
-            MediaType mt = ctx.getMediaType();
-            if (mt != null) {
-                if ("application".equals(mt.getType())) {
-                    ctString = mt.getSubtype();
-                } else {
-                    ctString = JAXRSUtils.mediaTypeToString(mt);
-                }
+        MediaType contentMediaType = ctx.getMediaType();
+        if (contentTypeRequired && contentMediaType != null) {
+            if ("application".equals(contentMediaType.getType())) {
+                ctString = contentMediaType.getSubtype();
+            } else {
+                ctString = JAXRSUtils.mediaTypeToString(contentMediaType);
             }
         }
         
-        ctx.setMediaType(JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE));
         if (useJweOutputStream) {
             JweEncryptionState encryption = theEncryptionProvider.createJweEncryptionState(ctString);
             try {
@@ -94,18 +91,25 @@ public class JweWriterInterceptor implements WriterInterceptor {
             
             ctx.setOutputStream(jweStream);
             ctx.proceed();
+            setJoseMediaType(ctx);
             jweStream.flush();
         } else {
             CachedOutputStream cos = new CachedOutputStream(); 
             ctx.setOutputStream(cos);
             ctx.proceed();
             String jweContent = theEncryptionProvider.encrypt(cos.getBytes(), ctString);
+            setJoseMediaType(ctx);
             IOUtils.copy(new ByteArrayInputStream(StringUtils.toBytesUTF8(jweContent)), 
                          actualOs);
             actualOs.flush();
         }
     }
     
+    private void setJoseMediaType(WriterInterceptorContext ctx) {
+        MediaType joseMediaType = JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE);
+        ctx.setMediaType(joseMediaType);
+    }
+    
     protected JweEncryptionProvider getInitializedEncryptionProvider() {
         if (encryptionProvider != null) {
             return encryptionProvider;    

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
index 36850c4..c79f305 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java
@@ -55,7 +55,6 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements
W
         JoseHeaders headers = new JoseHeaders();
         JwsSignatureProvider sigProvider = getInitializedSigProvider(headers);
         setContentTypeIfNeeded(headers, ctx);
-        ctx.setMediaType(JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE));
         OutputStream actualOs = ctx.getOutputStream();
         if (useJwsOutputStream) {
             JwsSignature jwsSignature = sigProvider.createJwsSignature(headers);
@@ -67,6 +66,7 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements
W
             Base64UrlOutputStream base64Stream = new Base64UrlOutputStream(jwsStream);
             ctx.setOutputStream(base64Stream);
             ctx.proceed();
+            setJoseMediaType(ctx);
             base64Stream.flush();
             jwsStream.flush();
         } else {
@@ -74,6 +74,7 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements
W
             ctx.setOutputStream(cos);
             ctx.proceed();
             JwsCompactProducer p = new JwsCompactProducer(headers, new String(cos.getBytes(),
"UTF-8"));
+            setJoseMediaType(ctx);
             writeJws(p, sigProvider, actualOs);
         }
     }
@@ -101,4 +102,8 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements
W
             }
         }
     }
+    private void setJoseMediaType(WriterInterceptorContext ctx) {
+        MediaType joseMediaType = JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE);
+        ctx.setMediaType(joseMediaType);
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/systests/rs-security/pom.xml
----------------------------------------------------------------------
diff --git a/systests/rs-security/pom.xml b/systests/rs-security/pom.xml
index c35e0c2..58e90bf 100644
--- a/systests/rs-security/pom.xml
+++ b/systests/rs-security/pom.xml
@@ -215,6 +215,11 @@
             <artifactId>bcprov-jdk15on</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.jaxrs</groupId>
+            <artifactId>jackson-jaxrs-json-provider</artifactId>
+            <version>2.4.1</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
index 119aa36..c451657 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java
@@ -21,12 +21,15 @@ package org.apache.cxf.systest.jaxrs.security.jwt;
 
 import java.net.URL;
 import java.security.Security;
+import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Properties;
 
 import javax.crypto.Cipher;
 
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
@@ -81,19 +84,21 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
     @Test
     public void testJweJwkPlainTextRSA() throws Exception {
         String address = "https://localhost:" + PORT + "/jwejwkrsa";
-        BookStore bs = createBookStore(address);
+        BookStore bs = createJweBookStore(address, null);
         String text = bs.echoText("book");
         assertEquals("book", text);
     }
     @Test
     public void testJweJwkBookBeanRSA() throws Exception {
         String address = "https://localhost:" + PORT + "/jwejwkrsa";
-        BookStore bs = createBookStore(address);
+        BookStore bs = createJweBookStore(address,
+                                       Collections.singletonList(new JacksonJsonProvider()));
         Book book = bs.echoBook(new Book("book", 123L));
         assertEquals("book", book.getName());
         assertEquals(123L, book.getId());
     }
-    private BookStore createBookStore(String address) throws Exception {
+    private BookStore createJweBookStore(String address, 
+                                      List<?> mbProviders) throws Exception {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = JAXRSJweJwsTest.class.getResource("client.xml");
@@ -106,6 +111,9 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
         jweWriter.setUseJweOutputStream(true);
         providers.add(jweWriter);
         providers.add(new JweClientResponseFilter());
+        if (mbProviders != null) {
+            providers.addAll(mbProviders);
+        }
         bean.setProviders(providers);
         bean.getProperties(true).put("rs.security.encryption.out.properties", 
                                      "org/apache/cxf/systest/jaxrs/security/bob.jwk.properties");
@@ -169,19 +177,49 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase
{
     @Test
     public void testJweRsaJwsRsa() throws Exception {
         String address = "https://localhost:" + PORT + "/jwejwsrsa";
-        doTestJweJwsRsa(address, null);
+        BookStore bs = createJweJwsBookStore(address, null, null);
+        String text = bs.echoText("book");
+        assertEquals("book", text);
     }
     @Test
-    public void testJweRsaJwsHMac() throws Exception {
+    public void testJweRsaJwsPlainTextHMac() throws Exception {
         String address = "https://localhost:" + PORT + "/jwejwshmac";
         HmacJwsSignatureProvider hmacProvider = 
             new HmacJwsSignatureProvider(ENCODED_MAC_KEY, Algorithm.HmacSHA256.getJwtName());
-        doTestJweJwsRsa(address, hmacProvider);
+        BookStore bs = createJweJwsBookStore(address, hmacProvider, null);
+        String text = bs.echoText("book");
+        assertEquals("book", text);
+    }
+    @Test
+    public void testJweRsaJwsBookHMac() throws Exception {
+        String address = "https://localhost:" + PORT + "/jwejwshmac";
+        HmacJwsSignatureProvider hmacProvider = 
+            new HmacJwsSignatureProvider(ENCODED_MAC_KEY, Algorithm.HmacSHA256.getJwtName());
+        BookStore bs = createJweJwsBookStore(address, hmacProvider,
+                                             Collections.singletonList(new JacksonJsonProvider()));
+        Book book = bs.echoBook(new Book("book", 123L));
+        assertEquals("book", book.getName());
+        assertEquals(123L, book.getId());
     }
     
     @Test
-    public void testJwsJwkHMac() throws Exception {
+    public void testJwsJwkPlainTextHMac() throws Exception {
+        String address = "https://localhost:" + PORT + "/jwsjwkhmac";
+        BookStore bs = createJwsBookStore(address, null);
+        String text = bs.echoText("book");
+        assertEquals("book", text);
+    }
+    @Test
+    public void testJwsJwkBookHMac() throws Exception {
         String address = "https://localhost:" + PORT + "/jwsjwkhmac";
+        BookStore bs = createJwsBookStore(address,
+                                       Collections.singletonList(new JacksonJsonProvider()));
+        Book book = bs.echoBook(new Book("book", 123L));
+        assertEquals("book", book.getName());
+        assertEquals(123L, book.getId());
+    }
+    private BookStore createJwsBookStore(String address, 
+                                         List<?> mbProviders) throws Exception {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = JAXRSJweJwsTest.class.getResource("client.xml");
@@ -194,12 +232,13 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase
{
         jwsWriter.setUseJwsOutputStream(true);
         providers.add(jwsWriter);
         providers.add(new JwsClientResponseFilter());
+        if (mbProviders != null) {
+            providers.addAll(mbProviders);
+        }
         bean.setProviders(providers);
         bean.getProperties(true).put("rs.security.signature.properties", 
-                                     "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties");
-        BookStore bs = bean.create(BookStore.class);
-        String text = bs.echoText("book");
-        assertEquals("book", text);
+            "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties");
+        return bean.create(BookStore.class);
     }
     @Test
     public void testJwsJwkEC() throws Exception {
@@ -249,8 +288,9 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
         String text = bs.echoText("book");
         assertEquals("book", text);
     }
-    private void doTestJweJwsRsa(String address, 
-                                 JwsSignatureProvider jwsSigProvider) throws Exception {
+    private BookStore createJweJwsBookStore(String address, 
+                                 JwsSignatureProvider jwsSigProvider,
+                                 List<?> mbProviders) throws Exception {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = JAXRSJweJwsTest.class.getResource("client.xml");
@@ -270,6 +310,9 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
         jwsWriter.setUseJwsOutputStream(true);
         providers.add(jwsWriter);
         providers.add(new JwsClientResponseFilter());
+        if (mbProviders != null) {
+            providers.addAll(mbProviders);
+        }
         bean.setProviders(providers);
         bean.getProperties(true).put("rs.security.encryption.out.properties", SERVER_JWEJWS_PROPERTIES);
         bean.getProperties(true).put("rs.security.signature.out.properties", CLIENT_JWEJWS_PROPERTIES);
@@ -278,9 +321,7 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
         PrivateKeyPasswordProvider provider = new PrivateKeyPasswordProviderImpl();
         bean.getProperties(true).put("rs.security.signature.key.password.provider", provider);
         bean.getProperties(true).put("rs.security.decryption.key.password.provider", provider);
-        BookStore bs = bean.create(BookStore.class);
-        String text = bs.echoText("book");
-        assertEquals("book", text);
+        return bean.create(BookStore.class);
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
index cbd1b13..45602d9 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
@@ -20,18 +20,32 @@
 package org.apache.cxf.systest.jaxrs.security.jwt;
 
 import java.net.URL;
+import java.security.Security;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
+
+import javax.crypto.Cipher;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.apache.cxf.rs.security.jose.jaxrs.JweClientResponseFilter;
+import org.apache.cxf.rs.security.jose.jaxrs.JweWriterInterceptor;
 import org.apache.cxf.rs.security.jose.jaxrs.JwsJsonClientResponseFilter;
 import org.apache.cxf.rs.security.jose.jaxrs.JwsJsonWriterInterceptor;
+import org.apache.cxf.rs.security.jose.jwa.Algorithm;
 import org.apache.cxf.systest.jaxrs.security.Book;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
 
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -42,19 +56,55 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase
{
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
                    launchServer(BookServerJwsJson.class, true));
+        registerBouncyCastleIfNeeded();
+    }
+    
+    private static void registerBouncyCastleIfNeeded() throws Exception {
+        try {
+            // Java 8 apparently has it
+            Cipher.getInstance(Algorithm.AES_GCM_ALGO_JAVA);
+        } catch (Throwable t) {
+            // Oracle Java 7
+            Security.addProvider(new BouncyCastleProvider());    
+        }
+    }
+    @AfterClass
+    public static void unregisterBouncyCastleIfNeeded() throws Exception {
+        Security.removeProvider(BouncyCastleProvider.class.getName());    
     }
     
     @Test
     public void testJwsJsonPlainTextHmac() throws Exception {
         String address = "https://localhost:" + PORT + "/jwsjsonhmac";
-        BookStore bs = createBookStore(address, "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties");
+        BookStore bs = createBookStore(address, 
+                                       "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties",
+                                       null);
         String text = bs.echoText("book");
         assertEquals("book", text);
     }
     @Test
-    public void testJweJsonBookBeanHmac() throws Exception {
+    public void testJwsJsonBookBeanHmac() throws Exception {
         String address = "https://localhost:" + PORT + "/jwsjsonhmac";
-        BookStore bs = createBookStore(address, "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties");
+        BookStore bs = createBookStore(address, 
+                                       "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties",
+                                       Collections.singletonList(new JacksonJsonProvider()));
+        Book book = bs.echoBook(new Book("book", 123L));
+        assertEquals("book", book.getName());
+        assertEquals(123L, book.getId());
+    }
+    @Test
+    public void testJweCompactJwsJsonBookBeanHmac() throws Exception {
+        String address = "https://localhost:" + PORT + "/jwejwsjsonhmac";
+        List<?> extraProviders = Arrays.asList(new JacksonJsonProvider(),
+                                               new JweWriterInterceptor(),
+                                               new JweClientResponseFilter());
+        String jwkStoreProperty = "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties";
+        Map<String, Object> props = new HashMap<String, Object>();
+        props.put("rs.security.signature.list.properties", jwkStoreProperty);
+        props.put("rs.security.encryption.properties", jwkStoreProperty);
+        BookStore bs = createBookStore(address, 
+                                       props,
+                                       extraProviders);
         Book book = bs.echoBook(new Book("book", 123L));
         assertEquals("book", book.getName());
         assertEquals(123L, book.getId());
@@ -66,7 +116,7 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase {
         List<String> properties = new ArrayList<String>();
         properties.add("org/apache/cxf/systest/jaxrs/security/secret.jwk.properties");
         properties.add("org/apache/cxf/systest/jaxrs/security/secret.jwk.hmac.properties");
-        BookStore bs = createBookStore(address, properties);
+        BookStore bs = createBookStore(address, properties, null);
         Book book = bs.echoBook(new Book("book", 123L));
         assertEquals("book", book.getName());
         assertEquals(123L, book.getId());
@@ -77,13 +127,20 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase
{
         String address = "https://localhost:" + PORT + "/jwsjsonhmac2";
         List<String> properties = new ArrayList<String>();
         properties.add("org/apache/cxf/systest/jaxrs/security/secret.jwk.hmac2.properties");
-        BookStore bs = createBookStore(address, properties);
+        BookStore bs = createBookStore(address, properties, null);
         Book book = bs.echoBook(new Book("book", 123L));
         assertEquals("book", book.getName());
         assertEquals(123L, book.getId());
     }
-       
-    private BookStore createBookStore(String address, Object properties) throws Exception
{
+    private BookStore createBookStore(String address, Object properties,
+                                      List<?> extraProviders) throws Exception {
+        return createBookStore(address, 
+                               Collections.singletonMap("rs.security.signature.list.properties",
properties),
+                               extraProviders);
+    }
+    private BookStore createBookStore(String address, 
+                                      Map<String, Object> mapProperties,
+                                      List<?> extraProviders) throws Exception {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = JAXRSJwsJsonTest.class.getResource("client.xml");
@@ -96,8 +153,11 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase
{
         writer.setUseJwsJsonOutputStream(true);
         providers.add(writer);
         providers.add(new JwsJsonClientResponseFilter());
+        if (extraProviders != null) {
+            providers.addAll(extraProviders);
+        }
         bean.setProviders(providers);
-        bean.getProperties(true).put("rs.security.signature.list.properties", properties);
+        bean.getProperties(true).putAll(mapProperties);
         return bean.create(BookStore.class);
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/server.xml
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/server.xml
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/server.xml
index b03b94c..0ba3a5a 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/server.xml
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/server.xml
@@ -98,6 +98,7 @@ under the License.
             <entry key="rs.security.decryption.key.password.provider" value-ref="keyPasswordProvider"/>
         </jaxrs:properties>
     </jaxrs:server>
+    <bean id="jackson" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
     <jaxrs:server address="https://localhost:${testutil.ports.jaxrs-jwt}/jwejwkrsa">
         <jaxrs:serviceBeans>
             <ref bean="serviceBean"/>
@@ -105,6 +106,7 @@ under the License.
         <jaxrs:providers>
             <ref bean="jweInFilter"/>
             <ref bean="jweOutFilter"/>
+            <ref bean="jackson"/>
         </jaxrs:providers>
         <jaxrs:properties>
             <entry key="rs.security.encryption.in.properties" value="org/apache/cxf/systest/jaxrs/security/alice.jwk.properties"/>
@@ -145,6 +147,7 @@ under the License.
             <ref bean="jweOutFilter"/>
             <ref bean="jwsHmacInFilter"/>
             <ref bean="jwsOutFilter"/>
+            <ref bean="jackson"/>
         </jaxrs:providers>
         <jaxrs:properties>
             <entry key="rs.security.encryption.in.properties" value="org/apache/cxf/systest/jaxrs/security/alice.rs.properties"/>
@@ -161,6 +164,7 @@ under the License.
         <jaxrs:providers>
             <ref bean="jwsInFilter"/>
             <ref bean="jwsOutFilter"/>
+            <ref bean="jackson"/>
         </jaxrs:providers>
         <jaxrs:properties>
             <entry key="rs.security.signature.properties" value="org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"/>

http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/serverJwsJson.xml
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/serverJwsJson.xml
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/serverJwsJson.xml
index a5e3608..3fbbeac 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/serverJwsJson.xml
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/serverJwsJson.xml
@@ -46,6 +46,7 @@ under the License.
     <bean id="serviceBean" class="org.apache.cxf.systest.jaxrs.security.jwt.BookStore"/>
     <bean id="jwsInFilter" class="org.apache.cxf.rs.security.jose.jaxrs.JwsJsonContainerRequestFilter"/>
     <bean id="jwsOutFilter" class="org.apache.cxf.rs.security.jose.jaxrs.JwsJsonWriterInterceptor"/>
+    <bean id="jackson" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
     <jaxrs:server address="https://localhost:${testutil.ports.jaxrs-jws-json}/jwsjsonhmac">
         <jaxrs:serviceBeans>
             <ref bean="serviceBean"/>
@@ -53,11 +54,30 @@ under the License.
         <jaxrs:providers>
             <ref bean="jwsInFilter"/>
             <ref bean="jwsOutFilter"/>
+            <ref bean="jackson"/>
         </jaxrs:providers>
         <jaxrs:properties>
             <entry key="rs.security.signature.list.properties" value="org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"/>
         </jaxrs:properties>
     </jaxrs:server>
+    <bean id="jweInFilter" class="org.apache.cxf.rs.security.jose.jaxrs.JweContainerRequestFilter"/>
+    <bean id="jweOutFilter" class="org.apache.cxf.rs.security.jose.jaxrs.JweWriterInterceptor"/>
+    <jaxrs:server address="https://localhost:${testutil.ports.jaxrs-jws-json}/jwejwsjsonhmac">
+        <jaxrs:serviceBeans>
+            <ref bean="serviceBean"/>
+        </jaxrs:serviceBeans>
+        <jaxrs:providers>
+            <ref bean="jwsInFilter"/>
+            <ref bean="jwsOutFilter"/>
+            <ref bean="jweInFilter"/>
+            <ref bean="jweOutFilter"/>
+            <ref bean="jackson"/>
+        </jaxrs:providers>
+        <jaxrs:properties>
+            <entry key="rs.security.signature.list.properties" value="org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"/>
+            <entry key="rs.security.encryption.properties" value="org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"/>
+        </jaxrs:properties>
+    </jaxrs:server>
     <jaxrs:server address="https://localhost:${testutil.ports.jaxrs-jws-json}/jwsjsonhmac2">
         <jaxrs:serviceBeans>
             <ref bean="serviceBean"/>


Mime
View raw message