cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1486181 - in /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims: LdapClaimsHandler.java LdapGroupClaimsHandler.java
Date Fri, 24 May 2013 19:25:23 GMT
Author: owulff
Date: Fri May 24 19:25:23 2013
New Revision: 1486181

URL: http://svn.apache.org/r1486181
Log:
Claim returned even filtered list was empty

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java?rev=1486181&r1=1486180&r2=1486181&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
Fri May 24 19:25:23 2013
@@ -155,10 +155,6 @@ public class LdapClaimsHandler implement
             LOG.finest("Retrieve claims for user " + user);
         }
         
-        
-
-
-        
         Map<String, Attribute> ldapAttributes = null;
         if (useLdapLookup) {
             AttributesMapper mapper = 

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java?rev=1486181&r1=1486180&r2=1486181&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapGroupClaimsHandler.java
Fri May 24 19:25:23 2013
@@ -203,7 +203,7 @@ public class LdapGroupClaimsHandler impl
         }
         
         if (LOG.isLoggable(Level.FINER)) {
-            LOG.finest("Retrieve groups for user " + user);
+            LOG.finer("Retrieve groups for user " + user);
         }
         
         List<String> groups = null;
@@ -212,15 +212,22 @@ public class LdapGroupClaimsHandler impl
         
         if (groups == null || groups.size() == 0) {
             if (LOG.isLoggable(Level.INFO)) {
-                LOG.finest("No groups found for user '" + user + "'");
+                LOG.info("No groups found for user '" + user + "'");
             }
             return new ClaimCollection();
         }
         
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Groups for user '" + parameters.getPrincipal().getName() + "': " +
groups);
+        }
+        
         String scope = null;
         if (getAppliesToScopeMapping() != null && getAppliesToScopeMapping().size()
> 0
             && parameters.getAppliesToAddress() != null) {
             scope = getAppliesToScopeMapping().get(parameters.getAppliesToAddress());
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("AppliesTo matchs with scope: " + scope);
+            }
         }
         
         String regex = this.groupNameGlobalFilter;
@@ -258,6 +265,12 @@ public class LdapGroupClaimsHandler impl
             }
         }
         
+        LOG.info("Filtered groups: " + filteredGroups);
+        if (filteredGroups.size() == 0) {
+            LOG.info("No matching groups found for user '" + principal + "'");
+            return new ClaimCollection();
+        }
+        
         ClaimCollection claimsColl = new ClaimCollection();
         Claim c = new Claim();
         c.setClaimType(URI.create(this.groupURI));
@@ -277,5 +290,4 @@ public class LdapGroupClaimsHandler impl
         return group.substring(roleStart, group.length() - trimEnd);
     }
     
-}
-
+}
\ No newline at end of file



Mime
View raw message