<?php
namespace App\Controller;
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class SecurityController extends AbstractController
{
#[Route('/login/azure/start', name: 'app.security.azure.start')]
public function azureStart(ClientRegistry $clientRegistry): Response
{
return $clientRegistry->getClient('azure_main')->redirect([], []);
}
/** @noinspection PhpUnusedParameterInspection */
#[Route('/login/azure/check', name: 'app.security.azure.check')]
public function azureCheck(Request $request, ClientRegistry $clientRegistry): Response
{
$clientRegistry->getClient('azure_main');
return new Response();
}
#[Route('/logout', name: 'app.security.logout')]
public function logout(): Response
{
throw new RuntimeException('This code should never be reached');
}
}