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 01EFDEB68 for ; Fri, 30 Nov 2012 13:04:14 +0000 (UTC) Received: (qmail 58730 invoked by uid 500); 30 Nov 2012 13:04:13 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 58607 invoked by uid 500); 30 Nov 2012 13:04:13 -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 58591 invoked by uid 99); 30 Nov 2012 13:04:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Nov 2012 13:04:12 +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; Fri, 30 Nov 2012 13:04:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 483A8238890B; Fri, 30 Nov 2012 13:03:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1415613 - in /cxf/branches/2.6.x-fixes: ./ rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java Date: Fri, 30 Nov 2012 13:03:51 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121130130351.483A8238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Fri Nov 30 13:03:50 2012 New Revision: 1415613 URL: http://svn.apache.org/viewvc?rev=1415613&view=rev Log: Merged revisions 1415609 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1415609 | sergeyb | 2012-11-30 12:59:14 +0000 (Fri, 30 Nov 2012) | 1 line [CXF-4666] Making it simpler to customize UserSubject creation ........ Modified: cxf/branches/2.6.x-fixes/ (props changed) cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java Propchange: cxf/branches/2.6.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/trunk:r1415609 Propchange: cxf/branches/2.6.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java?rev=1415613&r1=1415612&r2=1415613&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java (original) +++ cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java Fri Nov 30 13:03:50 2012 @@ -241,8 +241,13 @@ public abstract class RedirectionBasedGr this.sessionAuthenticityTokenProvider = sessionAuthenticityTokenProvider; } - private UserSubject createUserSubject(SecurityContext securityContext) { - return OAuthUtils.createSubject(securityContext); + protected UserSubject createUserSubject(SecurityContext securityContext) { + UserSubject subject = getMessageContext().getContent(UserSubject.class); + if (subject != null) { + return subject; + } else { + return OAuthUtils.createSubject(securityContext); + } } protected abstract Response createErrorResponse(MultivaluedMap params,