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 3EE61187E1 for ; Mon, 7 Dec 2015 14:07:22 +0000 (UTC) Received: (qmail 12145 invoked by uid 500); 7 Dec 2015 14:07:19 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 12074 invoked by uid 500); 7 Dec 2015 14:07:19 -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 12065 invoked by uid 99); 7 Dec 2015 14:07:19 -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, 07 Dec 2015 14:07:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 00A4EE0498; Mon, 7 Dec 2015 14:07:18 +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: <87bbdd44efc6433fb4de06acfae07c6f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: Make sure a Subject claim exists before setting up the JWT security context Date: Mon, 7 Dec 2015 14:07:18 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 4c687895d -> 14e7cea44 Make sure a Subject claim exists before setting up the JWT security context Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/14e7cea4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/14e7cea4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/14e7cea4 Branch: refs/heads/3.1.x-fixes Commit: 14e7cea440d7492d4f59584394162d593ec6ec69 Parents: 4c68789 Author: Colm O hEigeartaigh Authored: Mon Dec 7 14:03:21 2015 +0000 Committer: Colm O hEigeartaigh Committed: Mon Dec 7 14:06:35 2015 +0000 ---------------------------------------------------------------------- .../cxf/rs/security/jose/jaxrs/JwtAuthenticationFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/14e7cea4/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwtAuthenticationFilter.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwtAuthenticationFilter.java b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwtAuthenticationFilter.java index 97c127d..50c6a13 100644 --- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwtAuthenticationFilter.java +++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwtAuthenticationFilter.java @@ -73,7 +73,8 @@ public class JwtAuthenticationFilter extends AbstractJoseJwtConsumer implements // The token must be signed/verified with a public key to set up the security context, // unless we directly configure otherwise - if (isVerifiedWithAPublicKey(jwt) || enableUnsignedJwt) { + if (jwt.getClaims().getSubject() != null + && (isVerifiedWithAPublicKey(jwt) || enableUnsignedJwt)) { return new JwtTokenSecurityContext(jwt, roleClaim); } return null;