cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: More OAuth2 SPOP related updates
Date Fri, 19 Dec 2014 22:47:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 09af61719 -> cdb816233


More OAuth2 SPOP related updates


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

Branch: refs/heads/3.0.x-fixes
Commit: cdb8162333c73ab265a6134d7612836b951e4b83
Parents: 09af617
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Dec 19 22:32:31 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Dec 19 22:46:28 2014 +0000

----------------------------------------------------------------------
 .../rs/security/oauth2/common/OAuthAuthorizationData.java | 10 +++++-----
 .../code/AbstractAuthorizationCodeDataProvider.java       |  2 +-
 .../oauth2/grants/code/AuthorizationCodeGrantHandler.java |  6 +++---
 .../oauth2/grants/code/AuthorizationCodeRegistration.java | 10 +++++-----
 .../grants/code/DefaultEHCacheCodeDataProvider.java       |  2 +-
 .../grants/code/DefaultEncryptingCodeDataProvider.java    |  2 +-
 .../oauth2/grants/code/ServerAuthorizationCodeGrant.java  | 10 +++++-----
 .../oauth2/services/AuthorizationCodeGrantService.java    |  4 ++--
 .../oauth2/utils/crypto/ModelEncryptionSupport.java       |  4 ++--
 9 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/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 ce0860d5..06c04f8 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,7 +54,7 @@ public class OAuthAuthorizationData implements Serializable {
     
     private List<? extends Permission> permissions;
     private String audience;
-    private String codeVerifier;
+    private String codeChallenge;
     
     public OAuthAuthorizationData() {
     }
@@ -273,11 +273,11 @@ public class OAuthAuthorizationData implements Serializable {
         this.applicationCertificates = applicationCertificates;
     }
 
-    public void setClientCodeVerifier(String verifier) {
-        this.codeVerifier = verifier;
+    public void setClientCodeChallenge(String verifier) {
+        this.codeChallenge = verifier;
     }
-    public String getClientCodeVerifier() {
-        return codeVerifier;
+    public String getClientCodeChallenge() {
+        return codeChallenge;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractAuthorizationCodeDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractAuthorizationCodeDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractAuthorizationCodeDataProvider.java
index 71f1002..27a2b20 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractAuthorizationCodeDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AbstractAuthorizationCodeDataProvider.java
@@ -40,7 +40,7 @@ public abstract class AbstractAuthorizationCodeDataProvider
             new ServerAuthorizationCodeGrant(reg.getClient(), getCode(reg), getGrantLifetime(),
getIssuedAt());
         grant.setApprovedScopes(getApprovedScopes(reg));
         grant.setAudience(reg.getAudience());
-        grant.setClientCodeVerifier(reg.getClientCodeVerifier());
+        grant.setClientCodeChallenge(reg.getClientCodeChallenge());
         grant.setSubject(reg.getSubject());
         grant.setRedirectUri(reg.getRedirectUri());
         return grant;

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeGrantHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeGrantHandler.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeGrantHandler.java
index dc9cddd..7e6972f 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeGrantHandler.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeGrantHandler.java
@@ -71,9 +71,9 @@ public class AuthorizationCodeGrantHandler extends AbstractGrantHandler
{
             throw new OAuthServiceException(OAuthConstants.INVALID_REQUEST);
         }
         
-        String clientCodeVerifier = grant.getClientCodeVerifier();
-        if (clientCodeVerifier != null) {
-            String clientCodeChallenge = params.getFirst(OAuthConstants.AUTHORIZATION_CODE_VERIFIER);
+        String clientCodeChallenge = grant.getClientCodeChallenge();
+        if (clientCodeChallenge != null) {
+            String clientCodeVerifier = params.getFirst(OAuthConstants.AUTHORIZATION_CODE_VERIFIER);
             if (!compareCodeVerifierWithChallenge(clientCodeVerifier, clientCodeChallenge))
{
                 throw new OAuthServiceException(OAuthConstants.INVALID_GRANT);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeRegistration.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeRegistration.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeRegistration.java
index 6b0475c..a7126b4 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeRegistration.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/AuthorizationCodeRegistration.java
@@ -35,7 +35,7 @@ public class AuthorizationCodeRegistration {
     private String redirectUri;
     private UserSubject subject;
     private String audience;
-    private String clientCodeVerifier;
+    private String clientCodeChallenge;
     
     /**
      * Sets the {@link Client} reference
@@ -120,10 +120,10 @@ public class AuthorizationCodeRegistration {
     public void setAudience(String audience) {
         this.audience = audience;
     }
-    public String getClientCodeVerifier() {
-        return clientCodeVerifier;
+    public String getClientCodeChallenge() {
+        return clientCodeChallenge;
     }
-    public void setClientCodeVerifier(String clientCodeVerifier) {
-        this.clientCodeVerifier = clientCodeVerifier;
+    public void setClientCodeChallenge(String clientCodeChallenge) {
+        this.clientCodeChallenge = clientCodeChallenge;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
index c4e261f..d148423 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
@@ -78,7 +78,7 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi
             new ServerAuthorizationCodeGrant(reg.getClient(), getCode(reg), getGrantLifetime(),
getIssuedAt());
         grant.setApprovedScopes(getApprovedScopes(reg));
         grant.setAudience(reg.getAudience());
-        grant.setClientCodeVerifier(reg.getClientCodeVerifier());
+        grant.setClientCodeChallenge(reg.getClientCodeChallenge());
         grant.setSubject(reg.getSubject());
         grant.setRedirectUri(reg.getRedirectUri());
         return grant;

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEncryptingCodeDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEncryptingCodeDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEncryptingCodeDataProvider.java
index 6d50584..64e6276 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEncryptingCodeDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEncryptingCodeDataProvider.java
@@ -64,7 +64,7 @@ public class DefaultEncryptingCodeDataProvider extends DefaultEncryptingOAuthDat
             new ServerAuthorizationCodeGrant(reg.getClient(), getCode(reg), getGrantLifetime(),
getIssuedAt());
         grant.setApprovedScopes(getApprovedScopes(reg));
         grant.setAudience(reg.getAudience());
-        grant.setClientCodeVerifier(reg.getClientCodeVerifier());
+        grant.setClientCodeChallenge(reg.getClientCodeChallenge());
         grant.setSubject(reg.getSubject());
         grant.setRedirectUri(reg.getRedirectUri());
         return grant;

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/ServerAuthorizationCodeGrant.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/ServerAuthorizationCodeGrant.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/ServerAuthorizationCodeGrant.java
index a434214..b2b3835 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/ServerAuthorizationCodeGrant.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/ServerAuthorizationCodeGrant.java
@@ -38,7 +38,7 @@ public class ServerAuthorizationCodeGrant extends AuthorizationCodeGrant
{
     private List<String> approvedScopes = Collections.emptyList();
     private UserSubject subject;
     private String audience;
-    private String clientCodeVerifier;
+    private String clientCodeChallenge;
     
     public ServerAuthorizationCodeGrant() {
         
@@ -149,11 +149,11 @@ public class ServerAuthorizationCodeGrant extends AuthorizationCodeGrant
{
         this.audience = audience;
     }
 
-    public String getClientCodeVerifier() {
-        return clientCodeVerifier;
+    public String getClientCodeChallenge() {
+        return clientCodeChallenge;
     }
 
-    public void setClientCodeVerifier(String clientCodeVerifier) {
-        this.clientCodeVerifier = clientCodeVerifier;
+    public void setClientCodeChallenge(String clientCodeChallenge) {
+        this.clientCodeChallenge = clientCodeChallenge;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/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 97a2854..1ce7ddb 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
@@ -79,7 +79,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
         return secData;
     }
     private static void setCodeQualifier(OAuthAuthorizationData data, MultivaluedMap<String,
String> params) {
-        data.setClientCodeVerifier(params.getFirst(OAuthConstants.AUTHORIZATION_CODE_VERIFIER));
+        data.setClientCodeChallenge(params.getFirst(OAuthConstants.AUTHORIZATION_CODE_CHALLENGE));
     }
     protected Response createGrant(MultivaluedMap<String, String> params,
                                    Client client,
@@ -98,7 +98,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
         codeReg.setApprovedScope(approvedScope);
         codeReg.setSubject(userSubject);
         codeReg.setAudience(params.getFirst(OAuthConstants.CLIENT_AUDIENCE));
-        codeReg.setClientCodeVerifier(params.getFirst(OAuthConstants.AUTHORIZATION_CODE_VERIFIER));
+        codeReg.setClientCodeChallenge(params.getFirst(OAuthConstants.AUTHORIZATION_CODE_CHALLENGE));
         
         ServerAuthorizationCodeGrant grant = null;
         try {

http://git-wip-us.apache.org/repos/asf/cxf/blob/cdb81623/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
index e0a5730..4e8face 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
@@ -394,7 +394,7 @@ public final class ModelEncryptionSupport {
                                                                               Long.valueOf(parts[3]));
         grant.setRedirectUri(getStringPart(parts[4]));
         grant.setAudience(getStringPart(parts[5]));
-        grant.setClientCodeVerifier(getStringPart(parts[6]));
+        grant.setClientCodeChallenge(getStringPart(parts[6]));
         grant.setApprovedScopes(parseSimpleList(parts[7]));
         grant.setSubject(recreateUserSubject(parts[8]));
         return grant; 
@@ -420,7 +420,7 @@ public final class ModelEncryptionSupport {
         state.append(tokenizeString(grant.getAudience()));
         state.append(SEP);
         // 6: code verifier
-        state.append(tokenizeString(grant.getClientCodeVerifier()));
+        state.append(tokenizeString(grant.getClientCodeChallenge()));
         state.append(SEP);
         // 7: approved scopes
         state.append(grant.getApprovedScopes().toString());


Mime
View raw message