Skip to content

Commit

Permalink
Remove SAML-related login code and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
forevermatt committed Dec 11, 2024
1 parent 713edf7 commit 4016f3f
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 661 deletions.
36 changes: 2 additions & 34 deletions application/protected/components/AuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class AuthManager
*/
private $knownAuthTypes = array(
'hybrid' => '\Sil\DevPortal\components\HybridAuthUserIdentity',
'saml' => '\Sil\DevPortal\components\SamlUserIdentity',
'test-owner' => '\Sil\DevPortal\components\OwnerTestUserIdentity',
'test-user' => '\Sil\DevPortal\components\UserTestUserIdentity',
);
Expand Down Expand Up @@ -102,10 +101,6 @@ public function getDefaultProviderSlugFor($authType)
{
$defaultProvider = null;
switch ($authType) {
case 'saml':
$defaultProvider = 'SAML';
break;

case 'hybrid':
$hybridAuthManager = new HybridAuthManager();
$enabledProviders = $hybridAuthManager->getEnabledProvidersList();
Expand All @@ -132,7 +127,7 @@ public function getDefaultProviderSlugFor($authType)
* authentication. Throws an InvalidArgumentException if an unknown auth
* type is provided.
*
* @param string $authType The authentication type (eg: 'saml', 'hybrid').
* @param string $authType The authentication type (eg: 'hybrid').
* @return UserIdentity An instance of the correct subclass of
* <code>\Sil\DevPortal\components\UserIdentity</code>.
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -231,13 +226,6 @@ public static function getLoginMenuItems()
public function getLoginOptions()
{
$loginOptions = array();
if ($this->isAuthTypeEnabled('saml')) {
$loginOptions[] = new LoginOption(
'saml',
null,
\Yii::app()->params['saml']['idpName']
);
}
if ($this->isAuthTypeEnabled('hybrid')) {
$hybridAuthManager = new HybridAuthManager();
foreach ($hybridAuthManager->getEnabledProvidersList() as $provider) {
Expand Down Expand Up @@ -266,8 +254,6 @@ protected function getKnownAuthTypes()
public function isAuthTypeEnabled($authType)
{
switch ($authType) {
case 'saml':
return $this->isSamlAuthEnabled();
case 'hybrid':
return $this->isHybridAuthEnabled();
case 'test-user':
Expand All @@ -285,12 +271,7 @@ protected function isHybridAuthEnabled()
$hybridAuthManager = new HybridAuthManager();
return $hybridAuthManager->isHybridAuthEnabled();
}

protected function isSamlAuthEnabled()
{
return \Yii::app()->params['saml']['enabled'];
}


protected function isTestAuthEnabled()
{
$applicationEnv = $this->getApplicationEnv();
Expand All @@ -308,19 +289,6 @@ protected function isTestAuthEnabled()
*/
public function logout($webUser)
{
if (session_status() === PHP_SESSION_ACTIVE) {
/*
* Switch back to interacting with the Yii session (rather than the
* SimpleSMLphp session) so that we can log the user out of our local
* Yii application.
*
* We only began needing to do this when we upgraded from SimpleSAMLphp
* 1.16.3 to 1.17.2.
*/
$sspSession = \SimpleSAML\Session::getSessionFromRequest();
$sspSession->cleanup();
}

$authType = $webUser->getAuthType();

if ($authType) {
Expand Down
Loading

0 comments on commit 4016f3f

Please sign in to comment.