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:40:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes e31e934b9 -> 17049b58a


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/17049b58
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/17049b58
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/17049b58

Branch: refs/heads/3.0.x-fixes
Commit: 17049b58a2629089d043e374432be733d9f4cca9
Parents: e31e934
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:40:13 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/17049b58/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/17049b58/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