Allow more than one artifact in the list
authorgilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sat, 23 Jul 2005 18:50:33 +0000 (18:50 +0000)
committergilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sat, 23 Jul 2005 18:50:33 +0000 (18:50 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1759 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/serviceprovider/SPArtifactMapper.java

index c7643d3..78359c5 100644 (file)
@@ -103,8 +103,14 @@ public class SPArtifactMapper implements ArtifactMapper {
                Iterator artifacts = request.getArtifacts();
                if (!artifacts.hasNext())
                        throw new SAMLException("SPArtifactMapper was passed no artifact.");
-               SAMLArtifact artifact = (SAMLArtifact)artifacts.next();
-               EntityDescriptor entity = ((Metadata)appinfo).lookup(artifact);
+               EntityDescriptor entity = null;
+               SAMLArtifact artifact = null;
+               while (artifacts.hasNext()) {
+                       artifact = (SAMLArtifact)artifacts.next();
+                       entity = ((Metadata)appinfo).lookup(artifact);
+                       if (entity!=null)
+                               break;
+               }
                if (entity==null) {
                        throw new MetadataException("Unable to find Artifact issuer in Metadata.");
                }