You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2014/10/13 18:29:22 UTC

git commit: [CXF-6048] - Minor change to last commit

Repository: cxf
Updated Branches:
  refs/heads/master 3276ab729 -> b0b8cdae6


[CXF-6048] - Minor change to last commit


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

Branch: refs/heads/master
Commit: b0b8cdae6d2e82a9a56f757e3661ac40425847fa
Parents: 3276ab7
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon Oct 13 17:28:59 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Oct 13 17:28:59 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/cxf/ws/security/trust/STSTokenValidator.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b0b8cdae/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
index 686933d..4f001f7 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
@@ -28,7 +28,6 @@ import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 
 import org.w3c.dom.Element;
-
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -38,6 +37,7 @@ import org.apache.cxf.ws.security.tokenstore.TokenStore;
 import org.apache.cxf.ws.security.tokenstore.TokenStoreFactory;
 import org.apache.cxf.ws.security.trust.delegation.DelegationCallback;
 import org.apache.wss4j.common.ext.WSSecurityException;
+import org.apache.wss4j.common.principal.SAMLTokenPrincipalImpl;
 import org.apache.wss4j.common.saml.SamlAssertionWrapper;
 import org.apache.wss4j.dom.handler.RequestData;
 import org.apache.wss4j.dom.validate.Credential;
@@ -103,6 +103,7 @@ public class STSTokenValidator implements Validator {
                 SecurityToken transformedToken = getTransformedToken(tokenStore, hash);
                 if (transformedToken != null && !transformedToken.isExpired()) {
                     SamlAssertionWrapper assertion = new SamlAssertionWrapper(transformedToken.getToken());
+                    credential.setPrincipal(new SAMLTokenPrincipalImpl(assertion));
                     credential.setTransformedToken(assertion);
                     return credential;
                 }
@@ -128,6 +129,7 @@ public class STSTokenValidator implements Validator {
                 if (returnedToken != token) {
                     SamlAssertionWrapper assertion = new SamlAssertionWrapper(returnedToken.getToken());
                     credential.setTransformedToken(assertion);
+                    credential.setPrincipal(new SAMLTokenPrincipalImpl(assertion));
                     if (hash != 0) {
                         tokenStore.add(returnedToken);
                         token.setTransformedTokenIdentifier(returnedToken.getId());