cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1197191 - in /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator: SAMLTokenValidator.java SCTValidator.java
Date Thu, 03 Nov 2011 15:51:27 GMT
Author: coheigea
Date: Thu Nov  3 15:51:26 2011
New Revision: 1197191

URL: http://svn.apache.org/viewvc?rev=1197191&view=rev
Log:
Return a (cached) realm in the SCTValidator

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java?rev=1197191&r1=1197190&r2=1197191&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
Thu Nov  3 15:51:26 2011
@@ -196,10 +196,10 @@ public class SAMLTokenValidator implemen
                 }
             }
             
-            response.setValid(true);
             SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipal(assertion);
             response.setPrincipal(samlPrincipal);
             response.setTokenRealm(tokenRealm);
+            response.setValid(true);
         } catch (WSSecurityException ex) {
             LOG.log(Level.WARNING, "", ex);
         }

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=1197191&r1=1197190&r2=1197191&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
Thu Nov  3 15:51:26 2011
@@ -20,12 +20,14 @@ package org.apache.cxf.sts.token.validat
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.w3c.dom.Element;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.sts.STSConstants;
 import org.apache.cxf.sts.request.ReceivedToken;
 import org.apache.cxf.sts.request.TokenRequirements;
 
@@ -106,11 +108,17 @@ public class SCTValidator implements Tok
                     return response;
                 }
                 byte[] secret = (byte[])token.getSecret();
-                response.setValid(true);
                 Map<String, Object> properties = new HashMap<String, Object>();
                 properties.put(SCT_VALIDATOR_SECRET, secret);
                 response.setAdditionalProperties(properties);
                 response.setPrincipal(token.getPrincipal());
+                
+                Properties props = token.getProperties();
+                if (props != null) {
+                    String realm = props.getProperty(STSConstants.TOKEN_REALM);
+                    response.setTokenRealm(realm);
+                }
+                response.setValid(true);
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);
             }



Mime
View raw message