diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml index 86373005d..f503aa2d9 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml @@ -197,7 +197,7 @@ services: Surfnet\StepupSelfService\SelfServiceBundle\Service\SecondFactorAvailabilityHelper: arguments: - $providerRepository: '@gssp.provider_repository' + $viewConfigCollection: '@Surfnet\StepupBundle\Value\Provider\ViewConfigCollection' self_service.service.locale_provider: class: Surfnet\StepupSelfService\SelfServiceBundle\Service\LocaleProviderService diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorAvailabilityHelper.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorAvailabilityHelper.php index 79f0038c3..595dfebe0 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorAvailabilityHelper.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorAvailabilityHelper.php @@ -18,12 +18,14 @@ namespace Surfnet\StepupSelfService\SelfServiceBundle\Service; -use Surfnet\StepupSelfService\SamlStepupProviderBundle\Provider\ProviderRepository; + +use Surfnet\StepupBundle\Value\Provider\ViewConfigCollection; +use Surfnet\StepupSelfService\SamlStepupProviderBundle\Provider\ViewConfig; use Surfnet\StepupSelfService\SelfServiceBundle\Value\AvailableTokenCollection; readonly class SecondFactorAvailabilityHelper { - public function __construct(private ProviderRepository $providerRepository) + public function __construct(private ViewConfigCollection $viewConfigCollection) { } // Based on a list of available SF types for the current identity @@ -33,9 +35,9 @@ public function filter(SecondFactorTypeCollection $secondFactors): AvailableToke { $availableGsspSecondFactors = []; foreach ($secondFactors->available as $index => $secondFactor) { - if ($this->providerRepository->has($secondFactor)) { + if ($this->viewConfigCollection->isGssp($secondFactor)) { /** @var ViewConfig $secondFactorConfig */ - $secondFactorConfig = $this->providerRepository->get($secondFactor); + $secondFactorConfig = $this->viewConfigCollection->getByIdentifier($secondFactor); $availableGsspSecondFactors[$index] = $secondFactorConfig; // Remove the gssp second factors from the regular second factors. unset($secondFactors->available[$index]);