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 1F36317283 for ; Tue, 24 Feb 2015 19:42:22 +0000 (UTC) Received: (qmail 78360 invoked by uid 500); 24 Feb 2015 19:42:17 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 78285 invoked by uid 500); 24 Feb 2015 19:42:17 -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 78250 invoked by uid 99); 24 Feb 2015 19:42:17 -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; Tue, 24 Feb 2015 19:42:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 45676E0388; Tue, 24 Feb 2015 19:42:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ashakirin@apache.org To: commits@cxf.apache.org Date: Tue, 24 Feb 2015 19:42:15 -0000 Message-Id: <3a8648e3582d467ebff8d645fa198acc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cxf git commit: Preparing [CXF-6267]: Refactor issuing and renewing SAML token functionality into utility class Repository: cxf Updated Branches: refs/heads/master a79bb058a -> 3ae567d26 Preparing [CXF-6267]: Refactor issuing and renewing SAML token functionality into utility class Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/54508131 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/54508131 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/54508131 Branch: refs/heads/master Commit: 54508131155cc71099f6f54c5ee531e159d79ca2 Parents: 8077aaa Author: Andrei Shakirin Authored: Tue Feb 24 20:39:04 2015 +0100 Committer: Andrei Shakirin Committed: Tue Feb 24 20:39:04 2015 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/ws/security/trust/STSUtils.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/54508131/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java index f55e73f..74a91c4 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java @@ -89,10 +89,18 @@ public final class STSUtils { } public static STSClient getClient(Message message, String type) { - return getClient(message, type, null); + return getClientWithIssuer(message, type, null); } public static STSClient getClient(Message message, String type, IssuedToken itok) { + if (itok != null) { + return getClientWithIssuer(message, type, itok.getIssuer()); + } else { + return getClientWithIssuer(message, type, null); + } + } + + public static STSClient getClientWithIssuer(Message message, String type, Element issuer) { // Retrieve or create the STSClient STSClient client = (STSClient)message @@ -112,10 +120,10 @@ public final class STSUtils { // Find out if we have an EPR to get the STS Address (possibly via WS-MEX) - if (itok != null && itok.getIssuer() != null) { + if (issuer != null) { EndpointReferenceType epr = null; try { - epr = VersionTransformer.parseEndpointReference(itok.getIssuer()); + epr = VersionTransformer.parseEndpointReference(issuer); } catch (JAXBException e) { throw new IllegalArgumentException(e); } @@ -147,6 +155,7 @@ public final class STSUtils { return client; } + public static boolean configureViaEPR(STSClient client, EndpointReferenceType epr) { if (epr != null && client.getLocation() == null && client.getWsdlLocation() == null) { return true;