ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1490615 - /webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/KerberosSecurityTokenOutputProcessor.java
Date Fri, 07 Jun 2013 12:43:19 GMT
Author: coheigea
Date: Fri Jun  7 12:43:19 2013
New Revision: 1490615

URL: http://svn.apache.org/r1490615
Log:
Fixed some bugs in the Kerberos out processor

Modified:
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/KerberosSecurityTokenOutputProcessor.java

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/KerberosSecurityTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/KerberosSecurityTokenOutputProcessor.java?rev=1490615&r1=1490614&r2=1490615&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/KerberosSecurityTokenOutputProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/KerberosSecurityTokenOutputProcessor.java
Fri Jun  7 12:43:19 2013
@@ -48,8 +48,6 @@ public class KerberosSecurityTokenOutput
     @Override
     public void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
throws XMLStreamException, XMLSecurityException {
         try {
-            final String bstId = IDGenerator.generateID(null);
-
             XMLSecurityConstants.Action action = getAction();
 
             String tokenId = 
@@ -61,6 +59,7 @@ public class KerberosSecurityTokenOutput
                 kerberosToken = (KerberosClientSecurityToken)securityTokenProvider.getSecurityToken();
             }
             if (kerberosToken == null) {
+                final String bstId = IDGenerator.generateID(null);
                 final KerberosClientSecurityToken kerberosClientSecurityToken =
                         new KerberosClientSecurityToken(
                                 ((WSSSecurityProperties) getSecurityProperties()).getCallbackHandler(),
@@ -83,6 +82,7 @@ public class KerberosSecurityTokenOutput
                 
                 outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(bstId,
kerberosSecurityTokenProvider);
                 kerberosToken = kerberosClientSecurityToken;
+                tokenId = bstId;
             }
 
             FinalKerberosSecurityTokenOutputProcessor finalKerberosSecurityTokenOutputProcessor
=
@@ -91,10 +91,10 @@ public class KerberosSecurityTokenOutput
             finalKerberosSecurityTokenOutputProcessor.setAction(getAction());
         
             if (WSSConstants.SIGNATURE_WITH_KERBEROS_TOKEN.equals(action)) {
-                outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE,
bstId);
+                outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE,
tokenId);
                 finalKerberosSecurityTokenOutputProcessor.addBeforeProcessor(WSSSignatureOutputProcessor.class.getName());
             } else if (WSSConstants.ENCRYPT_WITH_KERBEROS_TOKEN.equals(action)) {
-                outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION,
bstId);
+                outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION,
tokenId);
                 finalKerberosSecurityTokenOutputProcessor.addAfterProcessor(EncryptEndingOutputProcessor.class.getName());
             }
             finalKerberosSecurityTokenOutputProcessor.init(outputProcessorChain);



Mime
View raw message