src/Controller/OAuthController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\RedirectResponse;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  10. class OAuthController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("/oauth/login", name="oauth_login")
  14.      */
  15.     public function index(ClientRegistry $clientRegistry): RedirectResponse
  16.     {
  17.         return $clientRegistry->getClient('keycloack')->redirect();
  18.     }
  19.     /**
  20.      * @Route("/oauth/callback", name="oauth_check")
  21.      */
  22.     public function connectCheckAction(Request $requestClientRegistry $clientRegistry)
  23.     {
  24.     }
  25.     /**
  26.      * @Route("/logout", name="logout")
  27.      */
  28.     public function logout()
  29.     {
  30.     }
  31. }