Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65BB6189B7 for ; Mon, 15 Feb 2016 14:23:32 +0000 (UTC) Received: (qmail 54797 invoked by uid 500); 15 Feb 2016 14:23:32 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 54735 invoked by uid 500); 15 Feb 2016 14:23:32 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 54726 invoked by uid 99); 15 Feb 2016 14:23:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Feb 2016 14:23:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0C4C8E0A3C; Mon, 15 Feb 2016 14:23:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: Making all the requested params available to consent screen and various complete authorization handlers Date: Mon, 15 Feb 2016 14:23:32 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master c59eb2176 -> e0ff97340 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/e0ff9734 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0ff9734 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0ff9734 Branch: refs/heads/master Commit: e0ff97340b769f9cb97aa5795fadaacfc17601eb Parents: c59eb21 Author: Sergey Beryozkin Authored: Mon Feb 15 14:23:16 2016 +0000 Committer: Sergey Beryozkin Committed: Mon Feb 15 14:23:16 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/e0ff9734/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 218ad19..9d169f1 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 applicationCertificates = new LinkedList(); private Map extraApplicationProperties = new HashMap(); + private MultivaluedMap requestParameters; private boolean implicitFlow; private List permissions; @@ -256,4 +258,12 @@ public class OAuthAuthorizationData extends OAuthRedirectionState implements Ser } return allPerms; } + + public MultivaluedMap getRequestParameters() { + return requestParameters; + } + + public void setRequestParameters(MultivaluedMap requestParameters) { + this.requestParameters = requestParameters; + } } http://git-wip-us.apache.org/repos/asf/cxf/blob/e0ff9734/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 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 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,