cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Fixing Jwt Grant
Date Fri, 19 Jun 2015 15:26:45 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 03ca89d27 -> 2e6cffde7


Fixing Jwt Grant


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

Branch: refs/heads/3.0.x-fixes
Commit: 2e6cffde7585b8d3ee08c38e506495e1c271e674
Parents: 03ca89d
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Jun 19 16:24:22 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Jun 19 16:26:28 2015 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java  | 9 ++++++++-
 .../cxf/rs/security/oauth2/grants/jwt/JwtBearerGrant.java   | 6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2e6cffde/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
index 827d266..e7cfd61 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JsonMapObjectReaderWriter.java
@@ -19,6 +19,7 @@
 package org.apache.cxf.jaxrs.provider.json;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.Collection;
@@ -29,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.helpers.IOUtils;
 
 
 
@@ -123,6 +125,9 @@ public class JsonMapObjectReaderWriter {
             out.append("\r\n ");
         }
     }
+    public JsonMapObject fromJsonToJsonObject(InputStream is) throws IOException {
+        return fromJsonToJsonObject(IOUtils.toString(is));
+    }
     public JsonMapObject fromJsonToJsonObject(String json) {
         JsonMapObject obj = new JsonMapObject();
         fromJson(obj, json);
@@ -133,7 +138,9 @@ public class JsonMapObjectReaderWriter {
         JsonObjectSettable settable = new JsonObjectSettable(obj);
         readJsonObjectAsSettable(settable, theJson.substring(1, theJson.length() - 1));
     }
-    
+    public Map<String, Object> fromJson(InputStream is) throws IOException {
+        return fromJson(IOUtils.toString(is));
+    }
     public Map<String, Object> fromJson(String json) {
         String theJson = json.trim();
         MapSettable nextMap = new MapSettable();

http://git-wip-us.apache.org/repos/asf/cxf/blob/2e6cffde/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrant.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrant.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrant.java
index a528705..f25942a 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrant.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/JwtBearerGrant.java
@@ -24,15 +24,15 @@ public class JwtBearerGrant extends AbstractJwtBearerGrant {
     private static final long serialVersionUID = -7296527609343431294L;
 
     public JwtBearerGrant(String assertion) {
-        this(assertion, false);
+        this(assertion, true);
     }
     
     public JwtBearerGrant(String assertion, boolean encoded) {
-        this(assertion, false, null);
+        this(assertion, encoded, null);
     }
     
     public JwtBearerGrant(String assertion, String scope) {
-        this(assertion, false, scope);
+        this(assertion, true, scope);
     }
     
     public JwtBearerGrant(String assertion, boolean encoded, String scope) {


Mime
View raw message