From 1b382e71b9013190961dbbfa29e5dc9ebb18b041 Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Tue, 16 Apr 2024 11:56:57 +0200 Subject: [PATCH] Repair the SelfVet ACS Controller The controller was not autoconfigurable fixed that by adding a service definition. And the MW client bundle command: SelfVetSecondFactorCommand was not configured correctly. A none existant field was set on it. Repaired that --- .../Controller/SelfVet/SelfVetConsumeController.php | 2 +- .../Resources/config/services.yaml | 13 ++++++++++++- .../Service/SecondFactorService.php | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SelfVet/SelfVetConsumeController.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SelfVet/SelfVetConsumeController.php index 32d68b78b..f906f171d 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SelfVet/SelfVetConsumeController.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Controller/SelfVet/SelfVetConsumeController.php @@ -97,7 +97,7 @@ public function consumeSelfVetAssertion(Request $httpRequest, string $secondFact $samlLogger->error( sprintf( 'Expected a response to the request with ID "%s", but the SAMLResponse was a response to a different request', - $initiatedRequestId + $initiatedRequestId->requestId() ) ); throw new AuthenticationException('Unexpected InResponseTo in SAMLResponse'); diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml index 21340f927..2a63a4a01 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Resources/config/services.yaml @@ -30,10 +30,21 @@ services: - '@surfnet_saml.http.redirect_binding' - '@surfnet_saml.http.post_binding' - '@surfnet_saml.hosted.service_provider' - - '@self_service.second_factor_test_idp' + - '@surfnet_saml.remote.idp' - '@surfnet_saml.logger' - '@logger' + Surfnet\StepupSelfService\SelfServiceBundle\Controller\SelfVet\SelfVetConsumeController: + arguments: + - "@logger" + - "@surfnet_stepup_self_service_self_service.service.second_factor" + - "@self_service.service.self_vet_marshaller" + - "@surfnet_saml.hosted.service_provider" + - '@surfnet_saml.remote.idp' + - "@surfnet_saml.http.post_binding" + - "@surfnet_saml.logger" + - "@request_stack" + surfnet_stepup_self_service_self_service.service.command: class: Surfnet\StepupSelfService\SelfServiceBundle\Service\CommandService arguments: diff --git a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php index 6b7879df0..99fea48de 100644 --- a/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php +++ b/src/Surfnet/StepupSelfService/SelfServiceBundle/Service/SecondFactorService.php @@ -84,7 +84,7 @@ public function selfVet(SelfVetCommand $command): bool $apiCommand->secondFactorId = $command->secondFactor->secondFactorIdentifier; $apiCommand->secondFactorType = $command->secondFactor->type; $apiCommand->authorityId = $command->identity->id; - $apiCommand->authoringSecondFactorLoa = $command->authoringLoa; + $apiCommand->authoringSecondFactorIdentifier = $command->authoringLoa; $result = $this->commandService->execute($apiCommand); return $result->isSuccessful();