cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1177575 - in /cxf/trunk/services/sts/sts-core/src: main/java/org/apache/cxf/sts/token/provider/ main/java/org/apache/cxf/sts/token/validator/ test/java/org/apache/cxf/sts/token/validator/
Date Fri, 30 Sep 2011 09:53:40 GMT
Author: coheigea
Date: Fri Sep 30 09:53:40 2011
New Revision: 1177575

URL: http://svn.apache.org/viewvc?rev=1177575&view=rev
Log:
Updated the token providers to store a principal in the cache

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java?rev=1177575&r1=1177574&r2=1177575&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
Fri Sep 30 09:53:40 2011
@@ -120,6 +120,7 @@ public class SAMLTokenProvider implement
             if (tokenParameters.getTokenStore() != null) {
                 SecurityToken securityToken = new SecurityToken(assertion.getId());
                 securityToken.setToken(token);
+                securityToken.setPrincipal(tokenParameters.getPrincipal());
                 int hash = 0;
                 byte[] signatureValue = assertion.getSignatureValue();
                 if (signatureValue != null && signatureValue.length > 0) {

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java?rev=1177575&r1=1177574&r2=1177575&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
Fri Sep 30 09:53:40 2011
@@ -130,6 +130,7 @@ public class SCTProvider implements Toke
             // putting the secret key into the cache
             SecurityToken token = new SecurityToken(sct.getIdentifier());
             token.setSecret(keyHandler.getSecret());
+            token.setPrincipal(tokenParameters.getPrincipal());
             if (lifetime > 0) {
                 Integer lifetimeInteger = new Integer(Long.valueOf(lifetime).intValue());
                 tokenParameters.getTokenStore().add(token, lifetimeInteger);

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java?rev=1177575&r1=1177574&r2=1177575&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
Fri Sep 30 09:53:40 2011
@@ -110,6 +110,7 @@ public class SCTValidator implements Tok
                 Map<String, Object> properties = new HashMap<String, Object>();
                 properties.put(SCT_VALIDATOR_SECRET, secret);
                 response.setAdditionalProperties(properties);
+                response.setPrincipal(token.getPrincipal());
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);
             }

Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java?rev=1177575&r1=1177574&r2=1177575&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java
Fri Sep 30 09:53:40 2011
@@ -77,6 +77,7 @@ public class SCTValidatorTest extends or
         assertTrue(
             validatorResponse.getAdditionalProperties().get(SCTValidator.SCT_VALIDATOR_SECRET)
!= null
         );
+        assertTrue(validatorResponse.getPrincipal().getName().equals("alice"));
         
         // Now remove the SCT from the cache
         tokenStore.remove(tokenStore.getToken(providerResponse.getTokenId()));



Mime
View raw message