use saml config interface instead of generic system configuration (#3551)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace App\Controller\Auth;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Configuration\SamlConfigurationInterface;
|
||||
use App\Saml\SamlAuthFactory;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -23,12 +23,12 @@ use Symfony\Component\Security\Core\Security;
|
||||
final class SamlController extends AbstractController
|
||||
{
|
||||
private $authFactory;
|
||||
private $systemConfiguration;
|
||||
private $samlConfiguration;
|
||||
|
||||
public function __construct(SamlAuthFactory $authFactory, SystemConfiguration $systemConfiguration)
|
||||
public function __construct(SamlAuthFactory $authFactory, SamlConfigurationInterface $samlConfiguration)
|
||||
{
|
||||
$this->authFactory = $authFactory;
|
||||
$this->systemConfiguration = $systemConfiguration;
|
||||
$this->samlConfiguration = $samlConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ final class SamlController extends AbstractController
|
||||
*/
|
||||
public function loginAction(Request $request)
|
||||
{
|
||||
if (!$this->systemConfiguration->isSamlActive()) {
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
throw $this->createNotFoundException('SAML deactivated');
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ final class SamlController extends AbstractController
|
||||
*/
|
||||
public function metadataAction()
|
||||
{
|
||||
if (!$this->systemConfiguration->isSamlActive()) {
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
throw $this->createNotFoundException('SAML deactivated');
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ final class SamlController extends AbstractController
|
||||
*/
|
||||
public function assertionConsumerServiceAction()
|
||||
{
|
||||
if (!$this->systemConfiguration->isSamlActive()) {
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
throw $this->createNotFoundException('SAML deactivated');
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ final class SamlController extends AbstractController
|
||||
*/
|
||||
public function logoutAction()
|
||||
{
|
||||
if (!$this->systemConfiguration->isSamlActive()) {
|
||||
if (!$this->samlConfiguration->isActivated()) {
|
||||
throw $this->createNotFoundException('SAML deactivated');
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace App\Controller\Security;
|
||||
|
||||
use App\Configuration\SamlConfigurationInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -21,10 +22,12 @@ use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
|
||||
final class SecurityController extends AbstractController
|
||||
{
|
||||
private $tokenManager;
|
||||
private $samlConfiguration;
|
||||
|
||||
public function __construct(CsrfTokenManagerInterface $tokenManager)
|
||||
public function __construct(CsrfTokenManagerInterface $tokenManager, SamlConfigurationInterface $samlConfiguration)
|
||||
{
|
||||
$this->tokenManager = $tokenManager;
|
||||
$this->samlConfiguration = $samlConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,6 +70,7 @@ final class SecurityController extends AbstractController
|
||||
'last_username' => $lastUsername,
|
||||
'error' => $error,
|
||||
'csrf_token' => $csrfToken,
|
||||
'saml_config' => $this->samlConfiguration,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user