Revision: 1817 Author: olavmrk Date: Mon Oct 5 04:51:43 2009 Log: AuthMemCookie: Support for authentication sources.
Update issue 215 This change sort of fixes the use of initSSO.php for www/authmemcookie.php by making it possible to use authsources with AuthMemCookie. http://code.google.com/p/simplesamlphp/source/detail?r=1817 Modified: /trunk/config-templates/authmemcookie.php /trunk/lib/SimpleSAML/AuthMemCookie.php /trunk/www/authmemcookie.php ======================================= --- /trunk/config-templates/authmemcookie.php Fri Mar 27 01:03:53 2009 +++ /trunk/config-templates/authmemcookie.php Mon Oct 5 04:51:43 2009 @@ -7,10 +7,20 @@ $config = array( /* - * What type of login Auth MemCookie will use. Can be either 'saml2' or 'shib13'. - * The default value is 'saml2'. + * 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' => 'saml2', + 'loginmethod' => 'authsource', + + /* + * The authentication source that should be used. + * + * This must be one of the authentication sources configured in config/authsources.php. + */ + 'authsource' => 'default-sp', /* * This is the name of the cookie we should save the session id in. The value of this option must match the ======================================= --- /trunk/lib/SimpleSAML/AuthMemCookie.php Mon Aug 17 02:05:29 2009 +++ /trunk/lib/SimpleSAML/AuthMemCookie.php Mon Oct 5 04:51:43 2009 @@ -52,6 +52,7 @@ public function getLoginMethod() { $loginMethod = $this->amcConfig->getString('loginmethod', 'saml2'); $supportedLogins = array( + 'authsource', 'saml2', 'shib13', ); @@ -61,6 +62,17 @@ return $loginMethod; } + + + /** + * Retrieve the authentication source that should be used to authenticate the user. + * + * @return string The login type which should be used for Auth MemCookie. + */ + public function getAuthSource() { + + return $this->amcConfig->getString('authsource'); + } /** ======================================= --- /trunk/www/authmemcookie.php Fri Aug 14 04:07:44 2009 +++ /trunk/www/authmemcookie.php Mon Oct 5 04:51:43 2009 @@ -28,6 +28,12 @@ /* Check if the user is authorized. We attempt to authenticate the user if not. */ $loginMethod = $amc->getLoginMethod(); switch($loginMethod) { + case 'authsource': + /* The default now. */ + $sourceId = $amc->getAuthSource(); + $s = new SimpleSAML_Auth_Simple($sourceId); + $s->requireAuth(); + break; case 'saml2': if (!$session->isValid('saml2') ) { SimpleSAML_Utilities::redirect( --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "simpleSAMLphp commits" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simplesamlphp-commits?hl=en -~----------~----~----~----~------~----~------~--~---
