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 DADBBCAE3 for ; Thu, 24 May 2012 10:12:18 +0000 (UTC) Received: (qmail 61486 invoked by uid 500); 24 May 2012 10:12:18 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 61385 invoked by uid 500); 24 May 2012 10:12:18 -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 61351 invoked by uid 99); 24 May 2012 10:12:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 10:12:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2012 10:12:15 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 302BB238896F; Thu, 24 May 2012 10:11:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1342188 - /cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java Date: Thu, 24 May 2012 10:11:54 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120524101154.302BB238896F@eris.apache.org> Author: sergeyb Date: Thu May 24 10:11:53 2012 New Revision: 1342188 URL: http://svn.apache.org/viewvc?rev=1342188&view=rev Log: [CXF-4337] Checking the local access token for null, thanks to Jordi Torrente Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java?rev=1342188&r1=1342187&r2=1342188&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java (original) +++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java Thu May 24 10:11:53 2012 @@ -114,11 +114,14 @@ public abstract class AbstractAccessToke if (accessTokenV == null && dataProvider != null && authScheme.equals(DEFAULT_AUTH_SCHEME)) { try { localAccessToken = dataProvider.getAccessToken(authSchemeData); - accessTokenV = new AccessTokenValidation(localAccessToken); } catch (OAuthServiceException ex) { + // to be handled next + } + if (localAccessToken == null) { AuthorizationUtils.throwAuthorizationFailure( Collections.singleton(authScheme)); } + accessTokenV = new AccessTokenValidation(localAccessToken); } if (accessTokenV == null) { AuthorizationUtils.throwAuthorizationFailure(supportedSchemes);