Skip to content
Snippets Groups Projects
Commit bcb38a54 authored by Jaime Perez's avatar Jaime Perez Committed by Jaime Perez Crespo
Browse files

Remove backwards compatibility (related to old SP interfaces) in AuthMemCookie.

parent b2e9de56
No related branches found
No related tags found
No related merge requests found
......@@ -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.
*
......
......@@ -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.
*
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment