<?php
namespace BigIdea\IdentityBundle\Controller;
use Drenso\OidcBundle\OidcClientInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class TeamMateAuthenticationController extends AbstractController
{
public function ssoEntrypoint(OidcClientInterface $oidcClient): RedirectResponse
{
return $oidcClient->generateAuthorizationRedirect(scopes: ['openid', 'profile', 'email']);
}
public function formLogin(AuthenticationUtils $authenticationUtils): Response
{
return $this->render('@Identity/Authentication/login.html.twig', [
'last_username' => $authenticationUtils->getLastUsername(),
'error' => $authenticationUtils->getLastAuthenticationError(),
]);
}
}