Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 83edf647f -> 434dd09df


Simplifying some code in TokenIssueOperation


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b38e4510
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b38e4510
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b38e4510

Branch: refs/heads/3.1.x-fixes
Commit: b38e4510c2063e234d6fe02231693a0a281a0147
Parents: 83edf64
Author: Colm O hEigeartaigh <cohei...@apache.org>
Authored: Wed Feb 10 14:35:14 2016 +0000
Committer: Colm O hEigeartaigh <cohei...@apache.org>
Committed: Wed Feb 10 17:24:30 2016 +0000

----------------------------------------------------------------------
 .../cxf/sts/operation/TokenIssueOperation.java  | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b38e4510/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
----------------------------------------------------------------------
diff --git 
a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
 
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
index d3ad4f4..02f7bec 100644
--- 
a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
+++ 
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
@@ -281,21 +281,15 @@ public class TokenIssueOperation extends 
AbstractOperation implements IssueOpera
             QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityTokenType();
         JAXBElement<RequestedSecurityTokenType> requestedToken = 
             
QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(requestedTokenType);
-        LOG.fine("Encrypting Issued Token: " + encryptIssuedToken);
-        if (encryptIssuedToken) {
-            requestedTokenType.setAny(tokenResponse.getToken());
-            response.getAny().add(requestedToken);
+        if (tokenResponse.getToken() instanceof String) {
+            Document doc = DOMUtils.newDocument();
+            Element tokenWrapper = doc.createElementNS(null, "TokenWrapper");
+            tokenWrapper.setTextContent((String)tokenResponse.getToken());
+            requestedTokenType.setAny(tokenWrapper);
         } else {
-            if (tokenResponse.getToken() instanceof String) {
-                Document doc = DOMUtils.newDocument();
-                Element tokenWrapper = doc.createElementNS(null, 
"TokenWrapper");
-                tokenWrapper.setTextContent((String)tokenResponse.getToken());
-                requestedTokenType.setAny(tokenWrapper);
-            } else {
-                requestedTokenType.setAny(tokenResponse.getToken());
-            }
-            response.getAny().add(requestedToken);
+            requestedTokenType.setAny(tokenResponse.getToken());
         }
+        response.getAny().add(requestedToken);
 
         if (returnReferences) {
             // RequestedAttachedReference

Reply via email to