Better error handling when session initiator abstains
authorscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 31 Jul 2012 01:09:48 +0000 (01:09 +0000)
committerscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 31 Jul 2012 01:09:48 +0000 (01:09 +0000)
git-svn-id: https://svn.shibboleth.net/cpp-sp/branches/REL_2@3739 cb58f699-b61c-0410-a6fe-9272a202ed29

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);