Favor the default endpoint if selected and the binding is known.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 24 Jun 2005 03:16:21 +0000 (03:16 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 24 Jun 2005 03:16:21 +0000 (03:16 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1668 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

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

index e69cca6..f1fd84f 100644 (file)
@@ -498,6 +498,17 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
 
                        if (sp != null) {
 
+                               // See if this is the default endpoint location.
+                               Endpoint defaultEndpoint = sp.getAssertionConsumerServiceManager().getDefaultEndpoint();
+                               if (defaultEndpoint.getLocation().equals(acceptanceURL)) {
+                                       
+                                       // If we recognize the default binding, this is the one to use.
+                                       if (defaultEndpoint.getBinding().equals(SAMLBrowserProfile.PROFILE_POST_URI))
+                                               return false;
+                                       else if (defaultEndpoint.getBinding().equals(SAMLBrowserProfile.PROFILE_ARTIFACT_URI))
+                                               return true;
+                               }
+                               
                                Iterator endpoints = sp.getAssertionConsumerServiceManager().getEndpoints();
                                while (endpoints.hasNext()) {
                                        Endpoint ep = (Endpoint) endpoints.next();