cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [3/3] cxf git commit: Making all the requested params available to consent screen and various complete authorization handlers
Date Mon, 15 Feb 2016 17:55:03 GMT
Making all the requested params available to consent screen and various complete authorization
handlers


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

Branch: refs/heads/3.1.x-fixes
Commit: b0cfaad377fef998773f590afea500a68ddc0ff0
Parents: d1bb6c1
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Feb 15 14:23:16 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Feb 15 17:54:38 2016 +0000

----------------------------------------------------------------------
 .../rs/security/oauth2/common/OAuthAuthorizationData.java | 10 ++++++++++
 .../oauth2/services/RedirectionBasedGrantService.java     |  5 ++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b0cfaad3/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 27cb511..08e5a5a 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
@@ -25,6 +25,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import javax.ws.rs.core.MultivaluedMap;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.cxf.rs.security.oauth2.utils.OAuthUtils;
@@ -49,6 +50,7 @@ public class OAuthAuthorizationData extends OAuthRedirectionState implements
Ser
     private String applicationLogoUri;
     private List<String> applicationCertificates = new LinkedList<String>();
     private Map<String, String> extraApplicationProperties = new HashMap<String,
String>();
+    private MultivaluedMap<String, String> requestParameters;
     private boolean implicitFlow;
     
     private List<OAuthPermission> permissions;
@@ -256,4 +258,12 @@ public class OAuthAuthorizationData extends OAuthRedirectionState implements
Ser
         }
         return allPerms;
     }
+
+    public MultivaluedMap<String, String> getRequestParameters() {
+        return requestParameters;
+    }
+
+    public void setRequestParameters(MultivaluedMap<String, String> requestParameters)
{
+        this.requestParameters = requestParameters;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/b0cfaad3/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 40a6771..22f248f 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
@@ -56,6 +56,7 @@ import org.apache.cxf.security.SecurityContext;
  * The Base Redirection-Based Grant Service
  */
 public abstract class RedirectionBasedGrantService extends AbstractOAuthService {
+    private static final String AUTHORIZATION_REQUEST_PARAMETERS = "authorization.request.parameters";
     private Set<String> supportedResponseTypes;
     private String supportedGrantType;
     private boolean useAllClientScopes;
@@ -202,6 +203,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
                                     authorizationCanBeSkipped);
         
         if (authorizationCanBeSkipped) {
+            getMessageContext().put(AUTHORIZATION_REQUEST_PARAMETERS, params);
             List<OAuthPermission> approvedScopes = 
                 preAuthorizationComplete ? preAuthorizedToken.getScopes() : requestedPermissions;

             return createGrant(data,
@@ -238,6 +240,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
                                                              boolean authorizationCanBeSkipped)
{
         
         OAuthAuthorizationData secData = new OAuthAuthorizationData();
+        secData.setRequestParameters(params);
         
         secData.setState(params.getFirst(OAuthConstants.STATE));
         secData.setRedirectUri(redirectUri);
@@ -357,7 +360,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
                                          partialMatchScopeValidation)) {
             return createErrorResponse(params, redirectUri, OAuthConstants.INVALID_SCOPE);
         }
-        
+        getMessageContext().put(AUTHORIZATION_REQUEST_PARAMETERS, params);
         // Request a new grant
         return createGrant(state,
                            client, 


Mime
View raw message