cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [7/7] cxf git commit: Fixing merge
Date Tue, 08 Dec 2015 18:06:47 GMT
Fixing merge


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

Branch: refs/heads/3.0.x-fixes
Commit: ca1d759d977d81634c1116d8e92e819024a900a4
Parents: 6498f99
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Dec 8 18:06:30 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Dec 8 18:06:30 2015 +0000

----------------------------------------------------------------------
 systests/rs-security/pom.xml                    |  12 --
 .../jaxrs/security/oauth2/JAXRSOAuth2Test.java  | 128 +------------------
 .../security/oauth2/SamlCallbackHandler.java    |   9 +-
 .../oauth2/grants/AuthorizationGrantTest.java   |  76 -----------
 .../grants/CallbackHandlerLoginHandler.java     |   2 +-
 .../oauth2/grants/OAuthDataProviderImpl.java    |  13 +-
 .../security/oauth2/grants/grants-server.xml    |   2 +-
 .../systest/jaxrs/security/oauth2/server.xml    |   4 -
 8 files changed, 18 insertions(+), 228 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/pom.xml
----------------------------------------------------------------------
diff --git a/systests/rs-security/pom.xml b/systests/rs-security/pom.xml
index 8c252bb..fad52e6 100644
--- a/systests/rs-security/pom.xml
+++ b/systests/rs-security/pom.xml
@@ -40,18 +40,6 @@
         </dependency>
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
-<<<<<<< HEAD
-            <artifactId>jetty-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-plus</artifactId>
-            <version>${cxf.jetty.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-=======
->>>>>>> 6106f46... Adding OAuth authorization grant tests
             <artifactId>jetty-webapp</artifactId>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
index 6558d87..664752f 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
@@ -20,12 +20,8 @@
 package org.apache.cxf.systest.jaxrs.security.oauth2;
 
 import java.net.URL;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
@@ -37,17 +33,10 @@ import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.rs.security.common.CryptoLoader;
-import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm;
-import org.apache.cxf.rs.security.jose.jws.JwsHeaders;
-import org.apache.cxf.rs.security.jose.jws.JwsJwtCompactProducer;
-import org.apache.cxf.rs.security.jose.jws.JwsSignatureProvider;
-import org.apache.cxf.rs.security.jose.jws.JwsUtils;
-import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
 import org.apache.cxf.rs.security.oauth2.auth.saml.Saml2BearerAuthOutInterceptor;
 import org.apache.cxf.rs.security.oauth2.client.OAuthClientUtils;
 import org.apache.cxf.rs.security.oauth2.common.AccessTokenGrant;
 import org.apache.cxf.rs.security.oauth2.common.ClientAccessToken;
-import org.apache.cxf.rs.security.oauth2.grants.jwt.JwtBearerGrant;
 import org.apache.cxf.rs.security.oauth2.grants.saml.Saml2BearerGrant;
 import org.apache.cxf.rs.security.oauth2.saml.Constants;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
@@ -55,7 +44,6 @@ import org.apache.cxf.rs.security.saml.SAMLUtils;
 import org.apache.cxf.rs.security.saml.SAMLUtils.SelfSignInfo;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.wss4j.common.crypto.Crypto;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -78,17 +66,8 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase {
         Crypto crypto = new CryptoLoader().loadCrypto(CRYPTO_RESOURCE_PROPERTIES);
         SelfSignInfo signInfo = new SelfSignInfo(crypto, "alice", "password"); 
         
-<<<<<<< HEAD
-        String assertion =  SAMLUtils.createAssertion(new SamlCallbackHandler(),
+        String assertion =  SAMLUtils.createAssertion(new SamlCallbackHandler(false),
                                                       signInfo).assertionToString();
-=======
-        SamlAssertionWrapper assertionWrapper = SAMLUtils.createAssertion(new SamlCallbackHandler(false),
-                                                                          signInfo);
-        Document doc = DOMUtils.newDocument();
-        Element assertionElement = assertionWrapper.toDOM(doc);
-        String assertion = DOM2Writer.nodeToString(assertionElement);
-        
->>>>>>> 6d818c6... Minor test modification
         Saml2BearerGrant grant = new Saml2BearerGrant(assertion);
         ClientAccessToken at = OAuthClientUtils.getAccessToken(wc, 
                                         new OAuthClientUtils.Consumer("alice", "alice"),

@@ -104,22 +83,14 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase
{
         
         Crypto crypto = new CryptoLoader().loadCrypto(CRYPTO_RESOURCE_PROPERTIES);
         SelfSignInfo signInfo = new SelfSignInfo(crypto, "alice", "password"); 
-        
-<<<<<<< HEAD
-        String assertion =  SAMLUtils.createAssertion(new SamlCallbackHandler2(),
-                                                      signInfo).assertionToString();
-=======
+
         SamlCallbackHandler samlCallbackHandler = new SamlCallbackHandler(true);
         samlCallbackHandler.setIssuer("alice");
         String audienceURI = "https://localhost:" + PORT + "/oauth2-auth/token";
         samlCallbackHandler.setAudience(audienceURI);
-        SamlAssertionWrapper assertionWrapper = SAMLUtils.createAssertion(samlCallbackHandler,
-                                                                          signInfo);
-        Document doc = DOMUtils.newDocument();
-        Element assertionElement = assertionWrapper.toDOM(doc);
-        String assertion = DOM2Writer.nodeToString(assertionElement);
->>>>>>> 6d818c6... Minor test modification
         
+        String assertion =  SAMLUtils.createAssertion(samlCallbackHandler,
+                                                      signInfo).assertionToString();
         String encodedAssertion = Base64UrlUtility.encode(assertion);
         
         Map<String, String> extraParams = new HashMap<String, String>();
@@ -151,41 +122,6 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase
{
         assertNotNull(at.getTokenKey());
     }
     
-    @Test
-    public void testJWTBearerGrant() throws Exception {
-        String address = "https://localhost:" + PORT + "/oauth2/token";
-        WebClient wc = createWebClient(address);
-        
-        // Create the JWT Token
-        String token = createToken("resourceOwner", "alice", address, true, true);
-        
-        JwtBearerGrant grant = new JwtBearerGrant(token);
-        ClientAccessToken at = OAuthClientUtils.getAccessToken(wc, 
-                                        new Consumer("alice", "alice"), 
-                                        grant,
-                                        false);
-        assertNotNull(at.getTokenKey());
-    }
-    
-    @Test
-    public void testJWTBearerAuthenticationDirect() throws Exception {
-        String address = "https://localhost:" + PORT + "/oauth2-auth-jwt/token";
-        WebClient wc = createWebClient(address);
-        
-        // Create the JWT Token
-        String token = createToken("resourceOwner", "alice", address, true, true);
-        
-        Map<String, String> extraParams = new HashMap<String, String>();
-        extraParams.put(Constants.CLIENT_AUTH_ASSERTION_TYPE,
-                        "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
-        extraParams.put(Constants.CLIENT_AUTH_ASSERTION_PARAM, token);
-        
-        ClientAccessToken at = OAuthClientUtils.getAccessToken(wc, 
-                                                               new CustomGrant(),
-                                                               extraParams);
-        assertNotNull(at.getTokenKey());
-    }
-    
     private WebClient createWebClient(String address) {
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
         bean.setAddress(address);
@@ -212,22 +148,15 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase
{
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("ws-security.callback-handler", 
                        "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback");
-<<<<<<< HEAD
-        properties.put("ws-security.saml-callback-handler", 
-                       "org.apache.cxf.systest.jaxrs.security.oauth2.SamlCallbackHandler2");
-        properties.put("ws-security.signature.username", "alice");
-        properties.put("ws-security.signature.properties", CRYPTO_RESOURCE_PROPERTIES);
-=======
         
         SamlCallbackHandler samlCallbackHandler = new SamlCallbackHandler(true);
         samlCallbackHandler.setIssuer("alice");
         String audienceURI = "https://localhost:" + PORT + "/oauth2-auth/token";
         samlCallbackHandler.setAudience(audienceURI);
-        properties.put("security.saml-callback-handler", samlCallbackHandler);
+        properties.put("ws-security.saml-callback-handler", samlCallbackHandler);
         
-        properties.put("security.signature.username", "alice");
-        properties.put("security.signature.properties", CRYPTO_RESOURCE_PROPERTIES);
->>>>>>> 6d818c6... Minor test modification
+        properties.put("ws-security.signature.username", "alice");
+        properties.put("ws-security.signature.properties", CRYPTO_RESOURCE_PROPERTIES);
         bean.setProperties(properties);
         
         bean.getOutInterceptors().add(new Saml2BearerAuthOutInterceptor());
@@ -237,49 +166,6 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase
{
         return wc;
     }
     
-    private String createToken(String issuer, String subject, String audience, 
-                               boolean expiry, boolean sign) {
-        // Create the JWT Token
-        JwtClaims claims = new JwtClaims();
-        claims.setSubject(subject);
-        if (issuer != null) {
-            claims.setIssuer(issuer);
-        }
-        claims.setIssuedAt(new Date().getTime() / 1000L);
-        if (expiry) {
-            Calendar cal = Calendar.getInstance();
-            cal.add(Calendar.SECOND, 60);
-            claims.setExpiryTime(cal.getTimeInMillis() / 1000L);
-        }
-        if (audience != null) {
-            claims.setAudiences(Collections.singletonList(audience));
-        }
-        
-        if (sign) {
-            // Sign the JWT Token
-            Properties signingProperties = new Properties();
-            signingProperties.put("rs.security.keystore.type", "jks");
-            signingProperties.put("rs.security.keystore.password", "password");
-            signingProperties.put("rs.security.keystore.alias", "alice");
-            signingProperties.put("rs.security.keystore.file", 
-                                  "org/apache/cxf/systest/jaxrs/security/certs/alice.jks");
-            signingProperties.put("rs.security.key.password", "password");
-            signingProperties.put("rs.security.signature.algorithm", "RS256");
-            
-            JwsHeaders jwsHeaders = new JwsHeaders(signingProperties);
-            JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims);
-            
-            JwsSignatureProvider sigProvider = 
-                JwsUtils.loadSignatureProvider(signingProperties, jwsHeaders);
-            
-            return jws.signWith(sigProvider);
-        }
-        
-        JwsHeaders jwsHeaders = new JwsHeaders(SignatureAlgorithm.NONE);
-        JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims);
-        return jws.getSignedEncodedJws();
-    }
-    
     private static class CustomGrant implements AccessTokenGrant {
 
         private static final long serialVersionUID = -4007538779198315873L;

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler.java
index 821d7a1..dbd9eb8 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler.java
@@ -31,14 +31,10 @@ import javax.security.auth.callback.UnsupportedCallbackException;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.PhaseInterceptorChain;
-<<<<<<< HEAD
 import org.apache.cxf.rt.security.claims.SAMLClaim;
-=======
-import org.apache.cxf.rt.security.saml.claims.SAMLClaim;
 import org.apache.wss4j.common.crypto.Crypto;
 import org.apache.wss4j.common.crypto.CryptoFactory;
 import org.apache.wss4j.common.ext.WSSecurityException;
->>>>>>> 6d818c6... Minor test modification
 import org.apache.wss4j.common.saml.SAMLCallback;
 import org.apache.wss4j.common.saml.bean.ActionBean;
 import org.apache.wss4j.common.saml.bean.AttributeBean;
@@ -49,6 +45,7 @@ import org.apache.wss4j.common.saml.bean.AuthDecisionStatementBean.Decision;
 import org.apache.wss4j.common.saml.bean.AuthenticationStatementBean;
 import org.apache.wss4j.common.saml.bean.ConditionsBean;
 import org.apache.wss4j.common.saml.bean.SubjectBean;
+import org.apache.wss4j.common.saml.bean.Version;
 import org.apache.wss4j.common.saml.builder.SAML2Constants;
 import org.joda.time.DateTime;
 
@@ -72,12 +69,8 @@ public class SamlCallbackHandler implements CallbackHandler {
         for (int i = 0; i < callbacks.length; i++) {
             if (callbacks[i] instanceof SAMLCallback) {
                 SAMLCallback callback = (SAMLCallback) callbacks[i];
-<<<<<<< HEAD
-                callback.setIssuer("resourceOwner");
-=======
                 callback.setSamlVersion(Version.SAML_20);
                 callback.setIssuer(issuer);
->>>>>>> 6d818c6... Minor test modification
                 
                 String subjectName = m != null ? (String)m.getContextualProperty("saml.subject.name")
: null;
                 if (subjectName == null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
index 5b757f6..0d6c3c5 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantTest.java
@@ -21,11 +21,8 @@ package org.apache.cxf.systest.jaxrs.security.oauth2.grants;
 
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
-import java.util.Properties;
 
 import javax.ws.rs.core.Form;
 import javax.ws.rs.core.Response;
@@ -33,12 +30,6 @@ import javax.ws.rs.core.Response;
 import org.apache.cxf.common.util.Base64UrlUtility;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.provider.json.JSONProvider;
-import org.apache.cxf.rs.security.jose.jwa.SignatureAlgorithm;
-import org.apache.cxf.rs.security.jose.jws.JwsHeaders;
-import org.apache.cxf.rs.security.jose.jws.JwsJwtCompactProducer;
-import org.apache.cxf.rs.security.jose.jws.JwsSignatureProvider;
-import org.apache.cxf.rs.security.jose.jws.JwsUtils;
-import org.apache.cxf.rs.security.jose.jwt.JwtClaims;
 import org.apache.cxf.rs.security.oauth2.common.ClientAccessToken;
 import org.apache.cxf.rs.security.oauth2.common.OAuthAuthorizationData;
 import org.apache.cxf.rs.security.oauth2.provider.OAuthJSONProvider;
@@ -294,31 +285,6 @@ public class AuthorizationGrantTest extends AbstractBusClientServerTestBase
{
         assertNotNull(accessToken.getRefreshToken());
     }
 
-    @org.junit.Test
-    public void testJWTAuthorizationGrant() throws Exception {
-        URL busFile = AuthorizationGrantTest.class.getResource("client.xml");
-        
-        String address = "https://localhost:" + PORT + "/services/";
-        WebClient client = WebClient.create(address, setupProviders(), "alice", "security",
busFile.toString());
-        
-        // Create the JWT Token
-        String token = createToken("DoubleItSTSIssuer", "consumer-id", 
-                                   "https://localhost:" + PORT + "/services/token", true,
true);
-
-        // Get Access Token
-        client.type("application/x-www-form-urlencoded").accept("application/json");
-        client.path("token");
-        
-        Form form = new Form();
-        form.param("grant_type", "urn:ietf:params:oauth:grant-type:jwt-bearer");
-        form.param("assertion", token);
-        form.param("client_id", "consumer-id");
-        Response response = client.post(form);
-        
-        ClientAccessToken accessToken = response.readEntity(ClientAccessToken.class);
-        assertNotNull(accessToken.getTokenKey());
-        assertNotNull(accessToken.getRefreshToken());
-    }
     private String getAuthorizationCode(WebClient client) {
         return getAuthorizationCode(client, null);
     }
@@ -402,46 +368,4 @@ public class AuthorizationGrantTest extends AbstractBusClientServerTestBase
{
         return samlAssertion.assertionToString();
     }
     
-    private String createToken(String issuer, String subject, String audience, 
-                               boolean expiry, boolean sign) {
-        // Create the JWT Token
-        JwtClaims claims = new JwtClaims();
-        claims.setSubject(subject);
-        if (issuer != null) {
-            claims.setIssuer(issuer);
-        }
-        claims.setIssuedAt(new Date().getTime() / 1000L);
-        if (expiry) {
-            Calendar cal = Calendar.getInstance();
-            cal.add(Calendar.SECOND, 60);
-            claims.setExpiryTime(cal.getTimeInMillis() / 1000L);
-        }
-        if (audience != null) {
-            claims.setAudiences(Collections.singletonList(audience));
-        }
-        
-        if (sign) {
-            // Sign the JWT Token
-            Properties signingProperties = new Properties();
-            signingProperties.put("rs.security.keystore.type", "jks");
-            signingProperties.put("rs.security.keystore.password", "password");
-            signingProperties.put("rs.security.keystore.alias", "alice");
-            signingProperties.put("rs.security.keystore.file", 
-                                  "org/apache/cxf/systest/jaxrs/security/certs/alice.jks");
-            signingProperties.put("rs.security.key.password", "password");
-            signingProperties.put("rs.security.signature.algorithm", "RS256");
-            
-            JwsHeaders jwsHeaders = new JwsHeaders(signingProperties);
-            JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims);
-            
-            JwsSignatureProvider sigProvider = 
-                JwsUtils.loadSignatureProvider(signingProperties, jwsHeaders);
-            
-            return jws.signWith(sigProvider);
-        }
-        
-        JwsHeaders jwsHeaders = new JwsHeaders(SignatureAlgorithm.NONE);
-        JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims);
-        return jws.getSignedEncodedJws();
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/CallbackHandlerLoginHandler.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/CallbackHandlerLoginHandler.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/CallbackHandlerLoginHandler.java
index 0442d68..48c509c 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/CallbackHandlerLoginHandler.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/CallbackHandlerLoginHandler.java
@@ -28,7 +28,7 @@ import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.rs.security.oauth2.common.UserSubject;
 import org.apache.cxf.rs.security.oauth2.grants.owner.ResourceOwnerLoginHandler;
 import org.apache.wss4j.dom.WSConstants;
-import org.apache.wss4j.dom.engine.WSSConfig;
+import org.apache.wss4j.dom.WSSConfig;
 import org.apache.wss4j.dom.handler.RequestData;
 import org.apache.wss4j.dom.message.token.UsernameToken;
 import org.apache.wss4j.dom.validate.Credential;

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/OAuthDataProviderImpl.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/OAuthDataProviderImpl.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/OAuthDataProviderImpl.java
index 0ae9708..94df132 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/OAuthDataProviderImpl.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/OAuthDataProviderImpl.java
@@ -62,12 +62,13 @@ public class OAuthDataProviderImpl extends DefaultEHCacheCodeDataProvider
{
             return Collections.emptyList();
         }
         
-        List<OAuthPermission> permissions = new ArrayList<>();
+        List<OAuthPermission> permissions = new ArrayList<OAuthPermission>();
         for (String requestedScope : requestedScopes) {
             if ("read_balance".equals(requestedScope)) {
                 OAuthPermission permission = new OAuthPermission();
+                permission.setPermission("read_balance");
                 permission.setHttpVerbs(Collections.singletonList("GET"));
-                List<String> uris = new ArrayList<>();
+                List<String> uris = new ArrayList<String>();
                 String partnerAddress = "/partners/balance/*";
                 uris.add(partnerAddress);
                 permission.setUris(uris);
@@ -75,8 +76,9 @@ public class OAuthDataProviderImpl extends DefaultEHCacheCodeDataProvider
{
                 permissions.add(permission);
             } else if ("create_balance".equals(requestedScope)) {
                 OAuthPermission permission = new OAuthPermission();
+                permission.setPermission("create_balance");
                 permission.setHttpVerbs(Collections.singletonList("POST"));
-                List<String> uris = new ArrayList<>();
+                List<String> uris = new ArrayList<String>();
                 String partnerAddress = "/partners/balance/*";
                 uris.add(partnerAddress);
                 permission.setUris(uris);
@@ -84,8 +86,9 @@ public class OAuthDataProviderImpl extends DefaultEHCacheCodeDataProvider
{
                 permissions.add(permission);
             } else if ("read_data".equals(requestedScope)) {
                 OAuthPermission permission = new OAuthPermission();
+                permission.setPermission("read_data");
                 permission.setHttpVerbs(Collections.singletonList("GET"));
-                List<String> uris = new ArrayList<>();
+                List<String> uris = new ArrayList<String>();
                 String partnerAddress = "/partners/data/*";
                 uris.add(partnerAddress);
                 permission.setUris(uris);
@@ -98,4 +101,4 @@ public class OAuthDataProviderImpl extends DefaultEHCacheCodeDataProvider
{
         
         return permissions;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml
index 3ef86fb..91a6c33 100644
--- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml
+++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml
@@ -127,7 +127,7 @@ under the License.
            <ref bean="basicAuthFilter"/>
        </jaxrs:providers>
        <jaxrs:properties>
-           <entry key="security.signature.properties" 
+           <entry key="ws-security.signature.properties" 
                   value="org/apache/cxf/systest/jaxrs/security/bob.properties"/>
            <entry key="rs.security.keystore.type" value="jks" />
            <entry key="rs.security.keystore.alias" value="alice"/>

http://git-wip-us.apache.org/repos/asf/cxf/blob/ca1d759d/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml
index fa196b9..d3af847 100644
--- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml
+++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml
@@ -88,17 +88,13 @@ under the License.
             <ref bean="serviceBean"/>
         </jaxrs:serviceBeans>
         <jaxrs:properties>
-<<<<<<< HEAD
             <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/jaxrs/security/alice.properties"/>
-=======
-            <entry key="security.signature.properties" value="org/apache/cxf/systest/jaxrs/security/alice.properties"/>
             <entry key="rs.security.keystore.type" value="jks" />
             <entry key="rs.security.keystore.alias" value="alice"/>
             <entry key="rs.security.keystore.password" value="password"/>
             <entry key="rs.security.keystore.file" 
                    value="org/apache/cxf/systest/jaxrs/security/certs/alice.jks" />
             <entry key="rs.security.signature.algorithm" value="RS256" />
->>>>>>> dfe90b6... Adding JWT Grant + Authn tests
         </jaxrs:properties>
     </jaxrs:server>
     <jaxrs:server address="https://localhost:${testutil.ports.jaxrs-oauth2}/oauth2-auth">


Mime
View raw message