Get all registered authenticators

@param int $service The type of service that is requested
@return Authenticator[] Return an array of Authenticator objects
978858
public function getApplicableAuthenticators($service = Authenticator::LOGIN)
    {
        $authenticators = $this->getAuthenticators();

        /** @var Authenticator $authenticator */
        foreach ($authenticators as $name => $authenticator) {
            if (!($authenticator->supportedServices() & $service)) {
                unset($authenticators[$name]);
            }
        }

        if (empty($authenticators)) {
            throw new LogicException('No applicable authenticators found');
        }

        return $authenticators;
    }
29188
protected function loadDeferredProvider($service)
	{
		$provider = $this->deferredServices[$service];

		// If the service provider has not already been loaded and registered we can
		// register it with the application and remove the service from this list
		// of deferred services, since it will already be loaded on subsequent.
		if ( ! isset($this->loadedProviders[$provider]))
		{
			$this->registerDeferredProvider($provider, $service);
		}
	}
542363
protected function oauth2Login($provider, $service)
	{
		if ($code = Input::get('code')) {
			try {
				$token = $service->requestAccessToken($code);
			} catch (Exception $e) {
				return Redirect::to(Session::pull('mmanos.social.onerror', '/'))
					->with(
						Config::get('laravel-social::error_flash_var'),
						'There was a problem logging in to your account (2).'
					);
			}
			
			return $this->processLogin($provider, $service, array(
				'token'         => $token->getAccessToken(),
				'refresh_token' => $token->getRefreshToken(),
				'end_of_life'   => $token->getEndOfLife(),
				'extra_params'  => $token->getExtraParams(),
			));
		}
		
		return Redirect::to((string) $service->getAuthorizationUri());
	}
676960
protected function transformCorreiosService(array $service)
    {
        $error = [];

        if ($service['Erro'] != 0) {
            $error = [
                'code' => $service['Erro'],
                'message' => $service['MsgErro'],
            ];
        }

        return [
            'name' => $this->friendlyServiceName($service['Codigo']),
            'code' => $service['Codigo'],
            'price' => floatval(str_replace(',', '.', $service['Valor'])),
            'deadline' => intval($service['PrazoEntrega']),
            'error' => $error,
        ];
    }
466738
public function get($service)
    {
        return $this->has($service) ? $this->container->get($service) : null;
    }
598331
public function getAuthenticationScopes(): array
    {

        // If we don't have any authentication data, then
        // only public calls can be made.
        if (is_null($this->getAuthentication()))
            return ['public'];

        // If there are no scopes that we know of, update them.
        // There will always be at least 1 as we add the internal
        // 'public' scope.
        if (count($this->getAuthentication()->scopes) <= 0)
            $this->setAuthenticationScopes();

        return $this->getAuthentication()->scopes;
    }
635487
public function getStatisticsServices():array
    {

        $services = $this->getAllServices();
        $counter = 0;
        $senable = 0;

        foreach ($services as $val) {
            if ($val->status == "enabled") {
                $senable++;
            }

            $counter++;
        }

        return (array("number" => $counter, "enabled" => $senable));
    }
184791
public function getLoginForms()
    {
        Deprecation::notice('5.0.0', 'Now handled by delegateToMultipleHandlers');

        return array_map(
            function (Authenticator $authenticator) {
                return [
                    $authenticator->getLoginHandler($this->Link())->loginForm()
                ];
            },
            $this->getApplicableAuthenticators()
        );
    }
73910
protected function getTokenCredentials() {
        return [
            'server' => $this->settings->getServiceEndpoint( 'sts' ),
            'endpoint' => $this->settings->getAuthenticationEndpoint(),
            'username' => $this->settings->username,
            'password' => $this->settings->password,
        ];
    }
5932
private function serviceExtensionMap(array $providers): array
    {
        $wrap = function ($factory) { return [$factory]; };

        return array_reduce($providers, function ($extensions, ServiceProviderInterface $provider) use ($wrap) {

            return array_merge_recursive($extensions, array_map($wrap, $provider->getExtensions()));

        }, []);
    }
227311
protected function getAllServices() {
    $container_builder = $this->containerBuilderGetter->getContainerBuilder();
    $definitions = $container_builder->getDefinitions();

    // Get an array of all the tags which are used by service collectors, so
    // we can filter out the services with those tags.
    $collector_tags = [];
    $collectors_info = $container_builder->findTaggedServiceIds('service_collector');
    foreach ($collectors_info as $service_name => $tag_infos) {
      // A single service collector service can collect on more than one tag.
      foreach ($tag_infos as $tag_info) {
        $tag = $tag_info['tag'];
        $collector_tags[$tag] = TRUE;
      }
    }

    $data = [];

    foreach ($definitions as $service_id => $definition) {
      // Skip services from Drush.
      if (substr($service_id, 0, strlen('drush.')) == 'drush.') {
        continue;
      }
      if (substr($service_id, - strlen('.commands')) == '.commands') {
        continue;
      }

      // Skip proxy services.
      if (substr($service_id, 0, strlen('drupal.proxy_original_service.')) == 'drupal.proxy_original_service.') {
        continue;
      }

      // Skip any services which are tagged for a collector, as they should not
      // be directly used by anything else.
      if (array_intersect_key($collector_tags, $definition->getTags())) {
        continue;
      }

      // Skip any services which are marked as deprecated.
      if ($definition->isDeprecated()) {
        continue;
      }

      // Skip entity.manager, which is not marked as deprecated, but is.
      if ($service_id == 'entity.manager') {
        continue;
      }

      $service_class = $definition->getClass();

      // Skip if no class defined, class_loader apparently, WTF?!.
      if (empty($service_class)) {
        continue;
      }

      // Skip if the class isn't loadable by PHP without causing a fatal, as we
      // can't work with just an ID to generate things like injection.
      // (The case of a service class whose parent does not exist happens if
      // a module Foo provides a service for module Bar's collection with a
      // service tag. Metatag module is one such example.)
      if (!$this->codeAnalyser->classIsUsable($service_class)) {
        continue;
      }

      // Skip if the clas doesn't exist.
      // The service class can sometimes actually be an interface, as with
      // cache services. (This is not documented!)
      if (!(class_exists($service_class) || interface_exists($service_class))) {
        continue;
      }

      // Get the short class name to use as a label.
      $service_class_pieces = explode('\\', $service_class);
      $service_short_class = array_pop($service_class_pieces);

      // If the class is in fact secretly an interface (this is the case for
      // cache services!) then remove the 'Interface' suffix.
      $service_short_class = preg_replace('/Interface$/', '', $service_short_class);

      $label = CaseString::pascal($service_short_class)->sentence();

      $data[$service_id] = [
        'id' => $service_id,
        'label' => $label,
        'static_method' => '', // Not used.
        'class' => '\\' . $service_class,
        'interface' => $this->getServiceInterface($service_class),
        'description' => "The {$label} service",
      ];
    }

    ksort($data);

    return $data;
  }
926197
public function buildTableRows($services)
    {
        $rows = array();
        foreach (array_keys($services) as $identifier) {
            try {
                $service = $this->resolveService($identifier);
                $rows[] = array(
                    $identifier,
                    $this->getServiceDescription($service),
                    $this->calculateServiceResolutionTime($identifier)
                );
            }
            catch (Exception $e) {
                $rows[] = array($identifier, 'Unable to resolve service.', 'N/A');
            }
        }
        return $rows;
    }
666735
protected function getAggregateService()
	{
		// Init
		$aggregate = [];

		foreach($this->app->tagged($this->getProviderKey()) as $service)
		{
			$aggregate[$service->getAlias()] = $service;
		}

		return $aggregate;
	}
832352
public function get($service)
    {
        // Is the service active?
        if (isset($this->active[$service])) {
            if ($this->loaded[$service]['singleton']) {
                return $this->active[$service];
            } else {
                return $this->load($service);
            }
        } elseif (isset($this->loaded[$service])) {
            // Is the service loaded?
            return $this->load($service);
        }

        $message  = "CDI the service accessed '$service' is not loaded in the DI-container.";
        $services = $this->getServices();
        natcasesort($services);
        $services = implode("\n", $services);
        $message .= " Loaded services are: <pre>$services</pre>";
        
        throw new \Exception($message);
    }
840133
public function getService($service)
    {
        foreach ($this->queue as $extension) {
            $new = call_user_func($extension, $service, $this->container);

            if ($new) {
                $service = $new;
            }
        }

        return $service;
    }
179654
public function getServiceNamesByType($type)
    {
        if (!$this->hasServices()) {
            return [];
        }
        $types = [];
        $services = $this->getServices();

        foreach ($services as $name => $service) {
            if ($service['type'] !== $type) {
                continue;
            }
            $types[] = $name;
        }

         return $types;
    }
100247
protected function validate(string $service)
    {
        throw_unless(Arr::exists(config('shield.services'), $service), UnknownServiceException::class, sprintf('Service [%s] not found.', $service));
        throw_unless(Arr::exists(config('shield.services.' . $service), 'driver'), UnknownServiceException::class, sprintf('Service [%s] must have a driver.', $service));

        $service = app(config('shield.services.' . $service . '.driver'));

        throw_unless($service instanceof Service, UnsupportedDriverException::class, sprintf('Driver [%s] must implement [%s].', get_class($service), Service::class));

        return $service;
    }