*/ class AuthController extends AbstractActionController { use ShibServiceAwareTrait; use UserServiceAwareTrait; /** * @return Response|array */ public function shibbolethAction() { $shibUser = $this->shibService->getAuthenticatedUser(); if ($shibUser === null) { return []; // la page d'aide s'affiche } /** @var AuthenticationService $authService */ $authService = $this->getServiceLocator()->get('zfcuser_auth_service'); try { $authService->getStorage()->write($shibUser->getId()); } catch (ExceptionInterface $e) { throw new RuntimeException("Impossible d'écrire dans le storage"); } $this->userService->userAuthenticated($shibUser); $redirectUrl = $this->params()->fromQuery('redirect', '/'); return $this->redirect()->toUrl($redirectUrl); } }