src\Controller\SecurityController.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
  4. use RuntimeException;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class SecurityController extends AbstractController
  10. {
  11.     #[Route('/login/azure/start'name'app.security.azure.start')]
  12.     public function azureStart(ClientRegistry $clientRegistry): Response
  13.     {
  14.         return $clientRegistry->getClient('azure_main')->redirect([], []);
  15.     }
  16.     /** @noinspection PhpUnusedParameterInspection */
  17.     #[Route('/login/azure/check'name'app.security.azure.check')]
  18.     public function azureCheck(Request $requestClientRegistry $clientRegistry): Response
  19.     {
  20.         $clientRegistry->getClient('azure_main');
  21.         return new Response();
  22.     }
  23.     #[Route('/logout'name'app.security.logout')]
  24.     public function logout(): Response
  25.     {
  26.         throw new RuntimeException('This code should never be reached');
  27.     }
  28. }