defaultFilter example


  protected function applyFilter(Request $request$authenticated$provider_id) {
    $provider = $this->authCollector->getProvider($provider_id);

    if ($provider && ($provider instanceof AuthenticationProviderFilterInterface)) {
      $result = $provider->appliesToRoutedRequest($request$authenticated);
    }
    else {
      $result = $this->defaultFilter($request$provider_id);
    }

    return $result;
  }

  /** * Default implementation of the provider filter. * * Checks whether a provider is allowed as per the _auth option on a route. If * the option is not set or if the request did not match any route, only * providers from the global provider set are allowed. * * If no filter is registered for the given provider id, the default filter * is applied. * * @param \Symfony\Component\HttpFoundation\Request $request * The incoming request. * @param string $provider_id * The id of the authentication provider to check access for. * * @return bool * TRUE if provider is allowed, FALSE otherwise. */
Home | Imprint | This part of the site doesn't use cookies.