cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: More minor updates to OAuth2 utils
Date Fri, 10 Oct 2014 12:39:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a3d446ae0 -> 75966585e


More minor updates to OAuth2 utils


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

Branch: refs/heads/master
Commit: 75966585e118fac8937fce077c5fe3c677616021
Parents: a3d446a
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Oct 10 13:38:38 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Oct 10 13:38:38 2014 +0100

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java  | 5 +++--
 .../cxf/rs/security/oauth2/provider/OAuthJSONProvider.java      | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/75966585/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
index 1550ba7..b63de40 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
@@ -355,11 +355,12 @@ public final class OAuthClientUtils {
                                         HttpRequestProperties httpProps) 
         throws OAuthServiceException {
         // this should all be handled by token specific serializers
-        if (OAuthConstants.BEARER_TOKEN_TYPE.equals(token.getTokenType())) {
+        String tokenType = token.getTokenType().toLowerCase();
+        if (OAuthConstants.BEARER_TOKEN_TYPE.equals(tokenType)) {
             sb.append(OAuthConstants.BEARER_AUTHORIZATION_SCHEME);
             sb.append(" ");
             sb.append(token.getTokenKey());
-        } else if (OAuthConstants.HAWK_TOKEN_TYPE.equals(token.getTokenType())) {
+        } else if (OAuthConstants.HAWK_TOKEN_TYPE.equals(tokenType)) {
             if (httpProps == null) {
                 throw new IllegalArgumentException("MAC scheme requires HTTP Request properties");
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/75966585/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
index 07db018..fba68a9 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProvider.java
@@ -173,11 +173,11 @@ public class OAuthJSONProvider implements MessageBodyWriter<Object>,
             if (key.startsWith("\"") && key.endsWith("\"")) {
                 key = key.substring(1, key.length() - 1);
             }
-            String value = pair.substring(index + 1);
+            String value = pair.substring(index + 1).trim();
             if (value.startsWith("\"") && value.endsWith("\"")) {
                 value = value.substring(1, value.length() - 1);
             }
-            map.put(key, value.trim());
+            map.put(key, value);
         }
         
         return map;


Mime
View raw message