Fix NullPonter and incorrect Relying Party selection for anonymous requesters.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 28 Mar 2004 04:04:18 +0000 (04:04 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 28 Mar 2004 04:04:18 +0000 (04:04 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@943 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

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

index e6ef9a9..e8f549b 100755 (executable)
@@ -245,6 +245,11 @@ public class AAServlet extends TargetFederationComponent {
                        //This is the requester name that will be passed to subsystems
                        String effectiveName = getEffectiveName(req, relyingParty);
 
+                       if (effectiveName == null) {
+                               log.debug("Using default Relying Party for unauthenticated provider.");
+                               relyingParty = targetMapper.getRelyingParty(null);
+                       }
+
                        //Map Subject to local principal
                        if (relyingParty.getIdentityProvider().getProviderId() != null
                                        && !relyingParty.getIdentityProvider().getProviderId().equals(
@@ -304,11 +309,11 @@ public class AAServlet extends TargetFederationComponent {
                                        }
                                }
 
-                               attrs = responder.getReleaseAttributes(principal, effectiveName.toString(), null,
-                                               (URI[]) requestedAttrs.toArray(new URI[0]));
+                               attrs = responder.getReleaseAttributes(principal, effectiveName, null, (URI[]) requestedAttrs
+                                               .toArray(new URI[0]));
                        } else {
                                log.info("Request does not designate specific attributes, resolving all available.");
-                               attrs = responder.getReleaseAttributes(principal, effectiveName.toString(), null);
+                               attrs = responder.getReleaseAttributes(principal, effectiveName, null);
                        }
 
                        log.info("Found " + attrs.length + " attribute(s) for " + principal.getName());