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 46D8C182A9 for ; Wed, 2 Dec 2015 11:19:59 +0000 (UTC) Received: (qmail 25545 invoked by uid 500); 2 Dec 2015 11:19:53 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 25489 invoked by uid 500); 2 Dec 2015 11:19:53 -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 25480 invoked by uid 99); 2 Dec 2015 11:19:52 -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; Wed, 02 Dec 2015 11:19:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CCC26E03A8; Wed, 2 Dec 2015 11:19:52 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: A few minor changes to the JWT Bearer Handler Date: Wed, 2 Dec 2015 11:19:52 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.0.x-fixes a109b9a7b -> d63cde6bc A few minor changes to the JWT Bearer Handler Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d63cde6b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d63cde6b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d63cde6b Branch: refs/heads/3.0.x-fixes Commit: d63cde6bc36eaa5aa0257ca6178e6691e0c28175 Parents: a109b9a Author: Colm O hEigeartaigh Authored: Wed Dec 2 10:50:13 2015 +0000 Committer: Colm O hEigeartaigh Committed: Wed Dec 2 11:17:27 2015 +0000 ---------------------------------------------------------------------- .../rs/security/oauth2/grants/jwt/AbstractJwtHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/d63cde6b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/AbstractJwtHandler.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/AbstractJwtHandler.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/AbstractJwtHandler.java index b8c6267..0177323 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/AbstractJwtHandler.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/jwt/AbstractJwtHandler.java @@ -47,7 +47,7 @@ public abstract class AbstractJwtHandler extends AbstractGrantHandler { } protected void validateSignature(JwsHeaders headers, String unsignedText, byte[] signature) { - JwsSignatureVerifier theSigVerifier = getInitializedSigVerifier(); + JwsSignatureVerifier theSigVerifier = getInitializedSigVerifier(headers); if (!theSigVerifier.verify(headers, unsignedText, signature)) { throw new OAuthServiceException(OAuthConstants.INVALID_GRANT); } @@ -67,7 +67,7 @@ public abstract class AbstractJwtHandler extends AbstractGrantHandler { } protected void validateIssuer(String issuer) { - if (issuer == null || !supportedIssuers.contains(issuer)) { + if (issuer == null || (supportedIssuers != null && !supportedIssuers.contains(issuer))) { throw new OAuthServiceException(OAuthConstants.INVALID_GRANT); } } @@ -87,11 +87,11 @@ public abstract class AbstractJwtHandler extends AbstractGrantHandler { public void setJwsVerifier(JwsSignatureVerifier jwsVerifier) { this.jwsVerifier = jwsVerifier; } - protected JwsSignatureVerifier getInitializedSigVerifier() { + protected JwsSignatureVerifier getInitializedSigVerifier(JwsHeaders headers) { if (jwsVerifier != null) { return jwsVerifier; } - return JwsUtils.loadSignatureVerifier(true); + return JwsUtils.loadSignatureVerifier(headers, true); } public int getTtl() {