cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Minor updates to OAuth2 service in 3.0.x
Date Fri, 19 Dec 2014 22:10:06 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes fb5bdb1f6 -> 09af61719


Minor updates to OAuth2 service in 3.0.x


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

Branch: refs/heads/3.0.x-fixes
Commit: 09af617199d23edccef00603889675628c943ba6
Parents: fb5bdb1
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Dec 19 22:09:43 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Dec 19 22:09:43 2014 +0000

----------------------------------------------------------------------
 .../oauth2/common/OAuthAuthorizationData.java        |  8 ++++++++
 .../services/AuthorizationCodeGrantService.java      | 15 +++++++++++++++
 2 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/09af6171/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
index 5c3201f..ce0860d5 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java
@@ -54,6 +54,7 @@ public class OAuthAuthorizationData implements Serializable {
     
     private List<? extends Permission> permissions;
     private String audience;
+    private String codeVerifier;
     
     public OAuthAuthorizationData() {
     }
@@ -272,4 +273,11 @@ public class OAuthAuthorizationData implements Serializable {
         this.applicationCertificates = applicationCertificates;
     }
 
+    public void setClientCodeVerifier(String verifier) {
+        this.codeVerifier = verifier;
+    }
+    public String getClientCodeVerifier() {
+        return codeVerifier;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/09af6171/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 19d3710..97a2854 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
@@ -28,6 +28,8 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 
 import org.apache.cxf.rs.security.oauth2.common.Client;
+import org.apache.cxf.rs.security.oauth2.common.OAuthAuthorizationData;
+import org.apache.cxf.rs.security.oauth2.common.OAuthPermission;
 import org.apache.cxf.rs.security.oauth2.common.OOBAuthorizationResponse;
 import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken;
 import org.apache.cxf.rs.security.oauth2.common.UserSubject;
@@ -66,6 +68,19 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
         }
         return super.startAuthorization(params, userSubject, client);
     }
+    protected OAuthAuthorizationData createAuthorizationData(Client client, 
+                                                             MultivaluedMap<String, String>
params,
+                                                             UserSubject subject,
+                                                             String redirectUri, 
+                                                             List<OAuthPermission>
perms) {
+        
+        OAuthAuthorizationData secData = super.createAuthorizationData(client, params, subject,
redirectUri, perms);
+        setCodeQualifier(secData, params);
+        return secData;
+    }
+    private static void setCodeQualifier(OAuthAuthorizationData data, MultivaluedMap<String,
String> params) {
+        data.setClientCodeVerifier(params.getFirst(OAuthConstants.AUTHORIZATION_CODE_VERIFIER));
+    }
     protected Response createGrant(MultivaluedMap<String, String> params,
                                    Client client,
                                    String redirectUri,


Mime
View raw message