From 71062202df8957301d7dcc812d120ff03f5b5d67 Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Mon, 4 Mar 2024 11:24:23 +0100 Subject: [PATCH] Remove SamlToken This concept was replaced by SamlBundle implementation. While at it, the dead code that instantiated the SamlToken, but never used it was removed. --- .../Authentication/Provider/SamlProvider.php | 10 +---- .../Authentication/Token/SamlToken.php | 39 ------------------- 2 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Token/SamlToken.php diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Provider/SamlProvider.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Provider/SamlProvider.php index a97a55a1c..ee27d50c4 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Provider/SamlProvider.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Provider/SamlProvider.php @@ -31,7 +31,6 @@ use Surfnet\StepupSelfService\SelfServiceBundle\Exception\MissingRequiredAttributeException; use Surfnet\StepupSelfService\SelfServiceBundle\Locale\PreferredLocaleProvider; use Surfnet\StepupSelfService\SelfServiceBundle\Security\Authentication\AuthenticatedIdentity; -use Surfnet\StepupSelfService\SelfServiceBundle\Security\Authentication\Token\SamlToken; use Surfnet\StepupSelfService\SelfServiceBundle\Service\IdentityService; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; @@ -121,19 +120,12 @@ public function getUser(Assertion $assertion): UserInterface $this->identityService->updateIdentity($identity); } - $authenticatedIdentity = new AuthenticatedIdentity($identity); - $authenticatedToken = new SamlToken(['ROLE_USER']); - - $authenticatedToken->setUser($authenticatedIdentity); - -// return $authenticatedToken; - return $authenticatedIdentity; + return new AuthenticatedIdentity($identity); } public function refreshUser(UserInterface $user): UserInterface { - // TODO: Implement refreshUser() method. return $user; } diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Token/SamlToken.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Token/SamlToken.php deleted file mode 100644 index 2981ecc8d..000000000 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Security/Authentication/Token/SamlToken.php +++ /dev/null @@ -1,39 +0,0 @@ -