From 9c2d45ed9cb5e99c91fbb0d54bdee4a149bdf595 Mon Sep 17 00:00:00 2001
From: Anders Lund <anders.lund@uninett.no>
Date: Mon, 16 Jun 2008 10:42:55 +0000
Subject: [PATCH] Give exception if session has timed out.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@660 44740490-163a-0410-bde0-09ae8108e29a
---
 www/auth/login-feide.php | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/www/auth/login-feide.php b/www/auth/login-feide.php
index 52a99407e..b5bf2c304 100644
--- a/www/auth/login-feide.php
+++ b/www/auth/login-feide.php
@@ -51,10 +51,14 @@ if (!array_key_exists('protocol', $_REQUEST)) {
 if ($_REQUEST['protocol'] != 'saml2') {
         SimpleSAML_Utilities::fatalError($session->getTrackID(), null, new Exception('This login module only works with SAML 2.0'));
 }
- 
-$protocol = $_REQUEST['protocol'];
-$authid = $_REQUEST['AuthId'];
-$authrequestcache = $session->getAuthnRequest($protocol, $authid);
+
+try {
+        $protocol = $_REQUEST['protocol'];
+        $authid = $_REQUEST['AuthId'];
+        $authrequestcache = $session->getAuthnRequest($protocol, $authid);
+} catch (Exception $e) {
+        SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NOSESSION', $e);
+}
  
 $spentityid = $authrequestcache['Issuer'];
 $spmetadata = $metadata->getMetadata($spentityid, 'saml20-sp-remote');
-- 
GitLab