/** * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function initiateSamlRequest() { $authnRequest = AuthnRequestFactory::createNewRequest($this->serviceProvider, $this->identityProvider); $authnRequest->setAuthenticationContextClassRef((string) $this->requiredLoa); $this->sessionHandler->setRequestId($authnRequest->getRequestId()); return $this->redirectBinding->createRedirectResponseFor($authnRequest); }
/** * @param string $provider * @return array|Response */ public function authenticateAction($provider) { $provider = $this->getProvider($provider); $authnRequest = AuthnRequestFactory::createNewRequest($provider->getServiceProvider(), $provider->getRemoteIdentityProvider()); $stateHandler = $provider->getStateHandler(); $stateHandler->setRequestId($authnRequest->getRequestId()); /** @var \Surfnet\SamlBundle\Http\RedirectBinding $redirectBinding */ $redirectBinding = $this->get('surfnet_saml.http.redirect_binding'); $this->getLogger()->notice(sprintf('Sending AuthnRequest with request ID: "%s" to GSSP "%s" at "%s"', $authnRequest->getRequestId(), $provider->getName(), $provider->getRemoteIdentityProvider()->getSsoUrl())); return $redirectBinding->createRedirectResponseFor($authnRequest); }
/** * @param string $procedureId * @param string $provider * @return array|Response */ public function authenticateAction($procedureId, $provider) { $this->denyAccessUnlessGranted(['ROLE_RA']); $logger = $this->get('ra.procedure_logger')->forProcedure($procedureId); $logger->notice('Generating GSSF verification request', ['provider' => $provider]); if (!$this->getVettingService()->hasProcedure($procedureId)) { $logger->notice(sprintf('Vetting procedure "%s" not found', $procedureId)); throw new NotFoundHttpException(sprintf('Vetting procedure "%s" not found', $procedureId)); } $provider = $this->getProvider($provider); $authnRequest = AuthnRequestFactory::createNewRequest($provider->getServiceProvider(), $provider->getRemoteIdentityProvider()); /** @var \Surfnet\StepupRa\RaBundle\Service\VettingService $vettingService */ $vettingService = $this->get('ra.service.vetting'); $authnRequest->setSubject($vettingService->getSecondFactorIdentifier($procedureId)); $stateHandler = $provider->getStateHandler(); $stateHandler->setRequestId($authnRequest->getRequestId()); /** @var \Surfnet\SamlBundle\Http\RedirectBinding $redirectBinding */ $redirectBinding = $this->get('surfnet_saml.http.redirect_binding'); $logger->notice(sprintf('Sending AuthnRequest with request ID: "%s" to GSSP "%s" at "%s"', $authnRequest->getRequestId(), $provider->getName(), $provider->getRemoteIdentityProvider()->getSsoUrl()), ['provider' => $provider]); $vettingService->startGssfVerification($procedureId); return $redirectBinding->createRedirectResponseFor($authnRequest); }
/** * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function initiateSamlRequest() { $authnRequest = AuthnRequestFactory::createNewRequest($this->serviceProvider, $this->identityProvider); $this->stateHandler->setRequestId($authnRequest->getRequestId()); return $this->redirectBinding->createRedirectResponseFor($authnRequest); }