Refactor authentication system (#2602)

Make auth configuration available via UI, remove FOSUserBundle and SAML-Bundle dependency
This commit is contained in:
Kevin Papst
2021-06-10 15:34:13 +02:00
committed by GitHub
parent 286b63e2c8
commit 7f20cb045c
155 changed files with 5590 additions and 1802 deletions

View File

@@ -10,7 +10,7 @@
namespace App\Controller\Auth;
use App\Configuration\SystemConfiguration;
use App\Saml\SamlAuth;
use App\Saml\SamlAuthFactory;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -22,12 +22,12 @@ use Symfony\Component\Security\Core\Security;
*/
final class SamlController extends AbstractController
{
private $oneLoginAuth;
private $authFactory;
private $systemConfiguration;
public function __construct(SamlAuth $oneLoginAuth, SystemConfiguration $systemConfiguration)
public function __construct(SamlAuthFactory $authFactory, SystemConfiguration $systemConfiguration)
{
$this->oneLoginAuth = $oneLoginAuth;
$this->authFactory = $authFactory;
$this->systemConfiguration = $systemConfiguration;
}
@@ -59,7 +59,7 @@ final class SamlController extends AbstractController
throw new \RuntimeException($error);
}
$this->oneLoginAuth->login($session->get('_security.main.target_path'));
$this->authFactory->create()->login($session->get('_security.main.target_path'));
}
/**
@@ -71,7 +71,7 @@ final class SamlController extends AbstractController
throw $this->createNotFoundException('SAML deactivated');
}
$metadata = $this->oneLoginAuth->getSettings()->getSPMetadata();
$metadata = $this->authFactory->create()->getSettings()->getSPMetadata();
$response = new Response($metadata);
$response->headers->set('Content-Type', 'xml');