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 <[email protected]>
Authored: Tue Feb 24 20:39:04 2015 +0100
Committer: Andrei Shakirin <[email protected]>
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;

Reply via email to