From commits-return-52323-archive-asf-public=cust-asf.ponee.io@cxf.apache.org Mon Sep 16 12:21:07 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7752B180638 for ; Mon, 16 Sep 2019 14:21:07 +0200 (CEST) Received: (qmail 73105 invoked by uid 500); 16 Sep 2019 12:21:06 -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 73083 invoked by uid 99); 16 Sep 2019 12:21:06 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Sep 2019 12:21:06 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id A53E780936; Mon, 16 Sep 2019 12:21:06 +0000 (UTC) Date: Mon, 16 Sep 2019 12:21:08 +0000 To: "commits@cxf.apache.org" Subject: [cxf] 02/09: Fixing OAuth scope test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: coheigea@apache.org In-Reply-To: <156863646597.15046.5271370011430179837@gitbox.apache.org> References: <156863646597.15046.5271370011430179837@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: cxf X-Git-Refname: refs/heads/3.3.x-fixes X-Git-Reftype: branch X-Git-Rev: df2f56d8a5d962ec921fe978a46a0314a05c8876 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190916122106.A53E780936@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch 3.3.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git commit df2f56d8a5d962ec921fe978a46a0314a05c8876 Author: Colm O hEigeartaigh AuthorDate: Wed Sep 11 01:08:19 2019 +0100 Fixing OAuth scope test (cherry picked from commit 39e32c4a3cf4b6dd35dae7cfccf47e2f23b8d253) --- .../cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java | 3 +-- .../jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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 d6e16f2..e4af350 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 @@ -396,8 +396,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService approvedScope.add(rScope); } } - if (!requestedScope.containsAll(approvedScope) - || !OAuthUtils.validateScopes(requestedScope, client.getRegisteredScopes(), + if (!OAuthUtils.validateScopes(requestedScope, client.getRegisteredScopes(), partialMatchScopeValidation)) { return createErrorResponse(params, redirectUri, OAuthConstants.INVALID_SCOPE); } diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java index 8bbb662..5b70662 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/grants/AuthorizationGrantNegativeTest.java @@ -212,13 +212,13 @@ public class AuthorizationGrantNegativeTest extends AbstractBusClientServerTestB client.type("application/json").accept("application/json"); client.query("client_id", "consumer-id"); client.query("response_type", "code"); - client.query("redirect_uri", "http://www.blah.bad.apache.org"); + client.query("redirect_uri", "http://www.blah.apache.org"); client.query("scope", "unknown-scope"); client.path("authorize/"); // No redirect URI Response response = client.get(); - assertEquals(400, response.getStatus()); + assertEquals(303, response.getStatus()); } // Send the authorization code twice to get an access token