src/Service/BaseFirewallMatcher.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Service;
  3. use Symfony\Component\HttpFoundation\Request;
  4. use Symfony\Component\HttpFoundation\RequestMatcherInterface;
  5. class BaseFirewallMatcher implements RequestMatcherInterface
  6. {
  7.         
  8.     // Should only be matched on login page when user first arrives to GET the form, if already validated with one
  9.     // of the other three security providers, they will be checked against their respective firewalls.
  10.     public function matches(Request $request) : bool
  11.     {
  12.         $session $request->getSession();
  13.         $oneValidated $session->get("_security_one"null);
  14.         $twoValidated $session->get("_security_two"null);
  15.         $threeValidated $session->get("_security_three"null);
  16.         $iamValidated $session->get("_security_iam"null);
  17.         // If already validated with another security provider
  18.         if ($oneValidated || $twoValidated || $threeValidated || $iamValidated) {
  19.             return false;
  20.         } else {
  21.             $url $request->getPathInfo();
  22.             // If these three logins are not matched
  23.             if ($url != "/login_1_check" && $url != "/login_2_check" && $url != "/login_3_check" && $url != "/login_iam_check") {
  24.                 return true;
  25.             }
  26.                 return false;
  27.             }
  28.     }
  29. }