Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
parijke committed Mar 4, 2024
1 parent 70d57b0 commit aad3257
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@
use Surfnet\SamlBundle\SAML2\Attribute\AttributeDictionary;
use Surfnet\SamlBundle\SAML2\Response\AssertionAdapter;
use Surfnet\SamlBundle\Security\Authentication\Provider\SamlProviderInterface;
use Surfnet\StepupBundle\Service\LoaResolutionService;
use Surfnet\StepupMiddlewareClientBundle\Identity\Dto\Identity;
use Surfnet\StepupRa\RaBundle\Exception\MissingRequiredAttributeException;
use Surfnet\StepupRa\RaBundle\Exception\UserNotRaException;
use Surfnet\StepupRa\RaBundle\Security\AuthenticatedIdentity;
use Surfnet\StepupRa\RaBundle\Security\Authentication\Token\SamlToken;
use Surfnet\StepupRa\RaBundle\Service\IdentityService;
use Surfnet\StepupRa\RaBundle\Service\ProfileService;
use Symfony\Component\DependencyInjection\Attribute\AsAlias;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
Expand All @@ -50,7 +45,7 @@ public function __construct(
private readonly ProfileService $profileService,
private readonly AttributeDictionary $attributeDictionary,
private readonly LoggerInterface $logger,
private readonly LoaResolutionService $loaResolutionService,

) {
}

Expand Down Expand Up @@ -98,12 +93,7 @@ public function getUser(Assertion $assertion): UserInterface
}
}

$authenticatedIdentity = new AuthenticatedIdentity($identity, $roles);
$loa = $this->loaResolutionService->getLoa($assertion->getAuthnContextClassRef());
$authenticatedToken = new SamlToken($loa, $roles);
$authenticatedToken->setUser($authenticatedIdentity);

return $authenticatedIdentity;
return new AuthenticatedIdentity($identity, $roles);
}

private function getSingleStringValue(string $attributeName, AssertionAdapter $translatedAssertion): string
Expand Down Expand Up @@ -145,19 +135,13 @@ private function getSingleStringValue(string $attributeName, AssertionAdapter $t
return $value;
}

public function supports(TokenInterface $token): bool
{
return $token instanceof SamlToken;
}

public function getNameId(Assertion $assertion): string
{
return $this->attributeDictionary->translate($assertion)->getNameID();
}

public function refreshUser(UserInterface $user): UserInterface
{
// TODO: Implement refreshUser() method.
return $user;
}

Expand Down

0 comments on commit aad3257

Please sign in to comment.