public function actionGo($application_id) { $user_id = $this->getUser()->getId(); if ($this->applicationManager->isAllow($user_id, $application_id)) { $token = $this->accessTokenManager->generate($user_id); $application = $this->applicationManager->getApplicationById($application_id); $this->redirectUrl($application->getScudURL() . $token->getKey()); } throw new BadRequestException(); }
public function actionGetAllApplications() { $response = []; $apps = $this->applicationManager->getAllApplications(); foreach ($apps as $app) { /** @var Application $app */ $response[] = ['name' => $app->getName(), 'url' => $app->getScudURL()]; } $this->sendResponse(new JsonResponse($response)); }