Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
@@ -17,23 +17,14 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
/**
|
||||
* @Route(path="/saml")
|
||||
*/
|
||||
#[Route(path: '/saml')]
|
||||
final class SamlController extends AbstractController
|
||||
{
|
||||
private $authFactory;
|
||||
private $samlConfiguration;
|
||||
|
||||
public function __construct(SamlAuthFactory $authFactory, SamlConfigurationInterface $samlConfiguration)
|
||||
public function __construct(private SamlAuthFactory $authFactory, private SamlConfigurationInterface $samlConfiguration)
|
||||
{
|
||||
$this->authFactory = $authFactory;
|
||||
$this->samlConfiguration = $samlConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/login", name="saml_login")
|
||||
*/
|
||||
#[Route(path: '/login', name: 'saml_login')]
|
||||
public function loginAction(Request $request)
|
||||
{
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
@@ -47,7 +38,7 @@ final class SamlController extends AbstractController
|
||||
|
||||
if ($request->attributes->has($authErrorKey)) {
|
||||
$error = $request->attributes->get($authErrorKey);
|
||||
} elseif (null !== $session && $session->has($authErrorKey)) {
|
||||
} elseif ($session->has($authErrorKey)) {
|
||||
$error = $session->get($authErrorKey);
|
||||
$session->remove($authErrorKey);
|
||||
}
|
||||
@@ -62,9 +53,7 @@ final class SamlController extends AbstractController
|
||||
$this->authFactory->create()->login($session->get('_security.main.target_path'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/metadata", name="saml_metadata")
|
||||
*/
|
||||
#[Route(path: '/metadata', name: 'saml_metadata')]
|
||||
public function metadataAction()
|
||||
{
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
@@ -79,9 +68,7 @@ final class SamlController extends AbstractController
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/acs", name="saml_acs")
|
||||
*/
|
||||
#[Route(path: '/acs', name: 'saml_acs')]
|
||||
public function assertionConsumerServiceAction()
|
||||
{
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
@@ -91,9 +78,7 @@ final class SamlController extends AbstractController
|
||||
throw new \RuntimeException('You must configure the check path in your firewall.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/logout", name="saml_logout")
|
||||
*/
|
||||
#[Route(path: '/logout', name: 'saml_logout')]
|
||||
public function logoutAction()
|
||||
{
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
|
||||
Reference in New Issue
Block a user