Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 05435f6

Browse files
authored
Merge pull request #24 from OpenConext/bugfix/fix-route-used-from-gssp-bundle
Fix sso redirect url from gssp-bundle
2 parents a31460e + 2e73ef1 commit 05435f6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Infrastructure/Controller/AuthenticationController.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
use StepupReadId\Infrastructure\Exception\NoActiveAuthnRequestException;
1010
use Surfnet\GsspBundle\Service\AuthenticationService;
1111
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
12+
use Symfony\Component\HttpFoundation\RedirectResponse;
1213
use Symfony\Component\HttpFoundation\Response;
1314
use Symfony\Component\Messenger\HandleTrait;
1415
use Symfony\Component\Messenger\MessageBusInterface;
1516
use Symfony\Component\Routing\Annotation\Route;
1617
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
18+
use function sprintf;
1719

1820
/**
1921
* @Route("/authentication", name="readid_authentication")
@@ -52,7 +54,7 @@ public function __invoke(): Response
5254
if ($this->authenticationService->isAuthenticated()) {
5355
$this->logger->info('Authentication is finalized returning to service provider');
5456

55-
return $this->authenticationService->replyToServiceProvider();
57+
return $this->replyToServiceProvider();
5658
}
5759

5860
$readySession = $this->handle(new GetStoredReadySessionQuery());
@@ -63,4 +65,12 @@ public function __invoke(): Response
6365
'returnUrl' => $this->generateUrl('readid_saml_sso_return', [], UrlGeneratorInterface::ABSOLUTE_URL),
6466
]);
6567
}
68+
69+
private function replyToServiceProvider(): RedirectResponse
70+
{
71+
$url = $this->generateUrl('readid_saml_sso_return');
72+
$this->logger->notice(sprintf('Created redirect response for sso return endpoint "%s"', $url));
73+
74+
return new RedirectResponse($url);
75+
}
6676
}

0 commit comments

Comments
 (0)