Better error handling when session initiator abstains
authorScott Cantor <cantor.2@osu.edu>
Tue, 31 Jul 2012 01:09:48 +0000 (01:09 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 31 Jul 2012 01:09:48 +0000 (01:09 +0000)
shibsp/ServiceProvider.cpp

index 97d5a5e..4fbf074 100644 (file)
@@ -339,7 +339,12 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
                     throw ConfigurationException("No default session initiator found, check configuration.");
             }
 
-            return initiator->run(request, false);
+            // Dispatch to SessionInitiator. This MUST handle the request, or we want to fail here.
+            // Used to fall through into doExport, but this is a cleaner exit path.
+            pair<bool,long> ret = initiator->run(request, false);
+            if (ret.first)
+                return ret;
+            throw ConfigurationException("Session initiator did not handle request for a new session, check configuration.");
         }
 
         request.setAuthType(authType.second);