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 3B5D8DA76 for ; Mon, 5 Nov 2012 16:01:04 +0000 (UTC) Received: (qmail 62691 invoked by uid 500); 5 Nov 2012 16:01:03 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 62590 invoked by uid 500); 5 Nov 2012 16:01:03 -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 62566 invoked by uid 99); 5 Nov 2012 16:01:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 16:01:03 +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; Mon, 05 Nov 2012 16:01:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1981E238896F; Mon, 5 Nov 2012 16:00:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1405853 - in /cxf/branches/2.6.x-fixes: ./ rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java Date: Mon, 05 Nov 2012 16:00:42 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121105160042.1981E238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Mon Nov 5 16:00:41 2012 New Revision: 1405853 URL: http://svn.apache.org/viewvc?rev=1405853&view=rev Log: Merged revisions 1405852 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1405852 | sergeyb | 2012-11-05 15:56:37 +0000 (Mon, 05 Nov 2012) | 1 line [CXF-4613] More updates to ImplicitGrantService with thanks to Steven Tippetts ........ 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/ImplicitGrantService.java Propchange: cxf/branches/2.6.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/trunk:r1405852 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/ImplicitGrantService.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/ImplicitGrantService.java?rev=1405853&r1=1405852&r2=1405853&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java (original) +++ cxf/branches/2.6.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java Mon Nov 5 16:00:41 2012 @@ -71,9 +71,14 @@ public class ImplicitGrantService extend // return the code by appending it as a fragment parameter to the redirect URI - StringBuilder sb = getUriWithFragment(params.getFirst(OAuthConstants.STATE), redirectUri); + String state = params.getFirst(OAuthConstants.STATE); + StringBuilder sb = getUriWithFragment(state, redirectUri); + if (state != null) { + sb.append("&"); + } sb.append(OAuthConstants.ACCESS_TOKEN).append("=").append(token.getTokenKey()); - sb.append(OAuthConstants.ACCESS_TOKEN_TYPE).append("=").append(token.getTokenType()); + sb.append("&") + .append(OAuthConstants.ACCESS_TOKEN_TYPE).append("=").append(token.getTokenType()); //TODO: token parameters should also be included probably // though it's not obvious the embedded client can deal with // MAC tokens or other sophisticated tokens @@ -83,7 +88,11 @@ public class ImplicitGrantService extend protected Response createErrorResponse(MultivaluedMap params, String redirectUri, String error) { - StringBuilder sb = getUriWithFragment(params.getFirst(OAuthConstants.STATE), redirectUri); + String state = params.getFirst(OAuthConstants.STATE); + StringBuilder sb = getUriWithFragment(state, redirectUri); + if (state != null) { + sb.append("&"); + } sb.append(OAuthConstants.ERROR_KEY).append("=").append(error); return Response.seeOther(URI.create(sb.toString())).build(); }