Fixed a bug with the artifact query parameter construction.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 16 Mar 2005 20:57:28 +0000 (20:57 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 16 Mar 2005 20:57:28 +0000 (20:57 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1303 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/provider/ShibbolethV1SSOHandler.java

index 35289f6..ac07ff5 100644 (file)
@@ -52,6 +52,7 @@ import org.opensaml.SAMLRequest;
 import org.opensaml.SAMLResponse;
 import org.opensaml.SAMLStatement;
 import org.opensaml.SAMLSubject;
+import org.opensaml.artifact.Artifact;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -197,14 +198,15 @@ public class ShibbolethV1SSOHandler extends BaseHandler implements IdPProtocolHa
 
                                Iterator iterator = artifacts.iterator();
                                StringBuffer artifactBuffer = new StringBuffer(); // Buffer for the transaction log
-                               while (iterator.hasNext()) {
-                                       destination.append("&SAMLart=");
-                                       String artifact = (String) iterator.next();
 
-                                       destination.append(URLEncoder.encode(artifact, "UTF-8"));
+                               // Construct the artifact query parameter
+                               while (iterator.hasNext()) {
+                                       Artifact artifact = (Artifact) iterator.next();
                                        artifactBuffer.append("(" + artifact + ")");
-
+                                       destination.append("&SAMLart=");
+                                       destination.append(artifact.encode());
                                }
+
                                log.debug("Redirecting to (" + destination.toString() + ").");
                                response.sendRedirect(destination.toString()); // Redirect to the artifact receiver