cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6306] Storing the single pre-registered redirect URI if no uri is set in the current redirect
Date Thu, 19 Mar 2015 15:40:36 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a79158c70 -> e1246b3d0


[CXF-6306] Storing the single pre-registered redirect URI if no uri is set in the current
redirect


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

Branch: refs/heads/master
Commit: e1246b3d0c00c9fe9489c0aacb683bf1de15d66b
Parents: a79158c
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Mar 19 15:40:15 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Mar 19 15:40:15 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java | 2 +-
 .../oauth2/services/AuthorizationCodeGrantService.java         | 4 +++-
 .../security/oauth2/services/RedirectionBasedGrantService.java | 6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e1246b3d/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 cfccf87..9b503d9 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
@@ -270,7 +270,7 @@ public final class OAuthClientUtils {
                 } catch (Exception ex) {
                     throw new ProcessingException(ex);
                 }
-                accessTokenService.header("Authorization", sb.toString());
+                accessTokenService.replaceHeader("Authorization", sb.toString());
             } else {
                 form.param(OAuthConstants.CLIENT_ID, consumer.getKey());
                 if (consumer.getSecret() != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/e1246b3d/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
index 4747f5a..60e9f0d 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
@@ -62,13 +62,15 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
     public AuthorizationCodeGrantService() {
         super(OAuthConstants.CODE_RESPONSE_TYPE, OAuthConstants.AUTHORIZATION_CODE_GRANT);
     }
+    @Override
     protected OAuthAuthorizationData createAuthorizationData(Client client, 
                                                              MultivaluedMap<String, String>
params,
+                                                             String redirectUri,
                                                              UserSubject subject,
                                                              List<OAuthPermission>
perms,
                                                              boolean preAuthorizedTokenAvailable)
{
         OAuthAuthorizationData data = 
-            super.createAuthorizationData(client, params, subject, perms, preAuthorizedTokenAvailable);
+            super.createAuthorizationData(client, params, redirectUri, subject, perms, preAuthorizedTokenAvailable);
         setCodeQualifier(data, params);
         return data;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e1246b3d/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
index 30bbdae..147101b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
@@ -165,7 +165,8 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
         
         // Populate the authorization challenge data 
         OAuthAuthorizationData data = 
-            createAuthorizationData(client, params, userSubject, permissions, preAuthorizedTokenAvailable);
+            createAuthorizationData(client, params, redirectUri, userSubject, permissions,

+                                    preAuthorizedTokenAvailable);
         
         if (preAuthorizedTokenAvailable) {
             return createGrant(data,
@@ -185,6 +186,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
      */
     protected OAuthAuthorizationData createAuthorizationData(Client client, 
                                                              MultivaluedMap<String, String>
params,
+                                                             String redirectUri, 
                                                              UserSubject subject,
                                                              List<OAuthPermission>
perms,
                                                              boolean preAuthorizedTokenAvailable)
{
@@ -192,7 +194,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
         OAuthAuthorizationData secData = new OAuthAuthorizationData();
         
         secData.setState(params.getFirst(OAuthConstants.STATE));
-        secData.setRedirectUri(params.getFirst(OAuthConstants.REDIRECT_URI));
+        secData.setRedirectUri(redirectUri);
         secData.setAudience(params.getFirst(OAuthConstants.CLIENT_AUDIENCE));
         secData.setClientId(client.getClientId());
         secData.setProposedScope(params.getFirst(OAuthConstants.SCOPE));


Mime
View raw message