Ugly Hack Alert!!!
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 5 Mar 2003 16:52:33 +0000 (16:52 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 5 Mar 2003 16:52:33 +0000 (16:52 +0000)
Make eduPersonScopedAffiliation pull from eduPersonAffiliation.  This shouldn't be necessary in the next release, when an abstraction layer will be present.

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@538 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/AAResponder.java

index b5db213..2d94d21 100755 (executable)
@@ -110,8 +110,7 @@ public class AAResponder {
 
                try {
                        //optimization... find out which attributes to resolve
-                       URI[] potentialAttributes =
-                               arpEngine.listPossibleReleaseAttributes(principal, requester, resource);
+                       URI[] potentialAttributes = arpEngine.listPossibleReleaseAttributes(principal, requester, resource);
 
                        //resolve for each attribute
                        Set arpAttributes = new HashSet();
@@ -119,15 +118,20 @@ public class AAResponder {
                        for (int i = 0; i < potentialAttributes.length; i++) {
                                ShibArpAttribute arpAttribute = new ShibArpAttribute(potentialAttributes[i].toString());
 
-                               Attributes attrs =
-                                       userCtx.getAttributes(
-                                               "",
-                                               new String[] {
-                                                        arpAttribute.getName().substring(arpAttribute.getName().lastIndexOf(":") + 1)});
-                               Attribute dAttr =
-                                       attrs.get(arpAttribute.getName().substring(arpAttribute.getName().lastIndexOf(":") + 1));
+                               Attribute dAttr;
+                               if (potentialAttributes[i].toString().equals("urn:mace:eduPerson:1.0:eduPersonScopedAffiliation")) {
+                                       Attributes attrs = userCtx.getAttributes("", new String[] { "eduPersonAffiliation" });
+                                       dAttr = attrs.get("eduPersonAffiliation");
+                               } else {
+                                       Attributes attrs =
+                                               userCtx.getAttributes(
+                                                       "",
+                                                       new String[] {
+                                                                arpAttribute.getName().substring(arpAttribute.getName().lastIndexOf(":") + 1)});
+                                       dAttr = attrs.get(arpAttribute.getName().substring(arpAttribute.getName().lastIndexOf(":") + 1));
+                               }
                                if (dAttr == null) {
-                                       continue;       
+                                       continue;
                                }
                                NamingEnumeration directoryValuesEnum = dAttr.getAll();
                                List directoryValues = new ArrayList();