From bcb38a5404b6ba22cea0a8aee90557bcec189a8a Mon Sep 17 00:00:00 2001 From: Jaime Perez <jaime.perez@uninett.no> Date: Wed, 5 Mar 2014 10:14:55 +0100 Subject: [PATCH] Remove backwards compatibility (related to old SP interfaces) in AuthMemCookie. --- config-templates/authmemcookie.php | 9 --------- lib/SimpleSAML/AuthMemCookie.php | 20 -------------------- www/authmemcookie.php | 20 ++------------------ 3 files changed, 2 insertions(+), 47 deletions(-) diff --git a/config-templates/authmemcookie.php b/config-templates/authmemcookie.php index 036e8c2e6..47509494c 100644 --- a/config-templates/authmemcookie.php +++ b/config-templates/authmemcookie.php @@ -6,15 +6,6 @@ $config = array( - /* - * What type of login Auth MemCookie will use. - * Can be either 'authsource', 'saml2' or 'shib13'. - * - * For backwards compatibility, the default value if unset is 'saml2'. - * New installations should use 'authsource'. - */ - 'loginmethod' => 'authsource', - /* * The authentication source that should be used. * diff --git a/lib/SimpleSAML/AuthMemCookie.php b/lib/SimpleSAML/AuthMemCookie.php index 2ce0b74d6..80fd00a50 100644 --- a/lib/SimpleSAML/AuthMemCookie.php +++ b/lib/SimpleSAML/AuthMemCookie.php @@ -43,26 +43,6 @@ class SimpleSAML_AuthMemCookie { } - /** - * Retrieve the login method which should be used to authenticate the user. - * - * @return string The login type which should be used for Auth MemCookie. - */ - public function getLoginMethod() { - $loginMethod = $this->amcConfig->getString('loginmethod', 'saml2'); - $supportedLogins = array( - 'authsource', - 'saml2', - 'shib13', - ); - if(!in_array($loginMethod, $supportedLogins, TRUE)) { - throw new Exception('Configuration option \'loginmethod\' contains an invalid value.'); - } - - return $loginMethod; - } - - /** * Retrieve the authentication source that should be used to authenticate the user. * diff --git a/www/authmemcookie.php b/www/authmemcookie.php index b385400c9..dc52fc2c3 100644 --- a/www/authmemcookie.php +++ b/www/authmemcookie.php @@ -24,24 +24,8 @@ try { /* Load Auth MemCookie configuration. */ $amc = SimpleSAML_AuthMemCookie::getInstance(); - /* Determine the method we should use to authenticate the user and retrieve the attributes. */ - $loginMethod = $amc->getLoginMethod(); - switch($loginMethod) { - case 'authsource': - /* The default now. */ - $sourceId = $amc->getAuthSource(); - $s = new SimpleSAML_Auth_Simple($sourceId); - break; - case 'saml2': - $s = new SimpleSAML_Auth_BWC('saml2/sp/initSSO.php', 'saml2'); - break; - case 'shib13': - $s = new SimpleSAML_Auth_BWC('shib13/sp/initSSO.php', 'shib13'); - break; - default: - /* Should never happen, as the login method is checked in the AuthMemCookie class. */ - throw new Exception('Invalid login method.'); - } + $sourceId = $amc->getAuthSource(); + $s = new SimpleSAML_Auth_Simple($sourceId); /* Check if the user is authorized. We attempt to authenticate the user if not. */ $s->requireAuth(); -- GitLab