You are here

public function TfaLoginPluginManager::getPlugins in Two-factor Authentication (TFA) 8

Returns an array of enabled login plugins.

Parameters

array $configuration: The configuration array.

Return value

array|null An array of login plugins.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Component\Plugin\Exception\PluginException

File

src/TfaLoginPluginManager.php, line 117

Class

TfaLoginPluginManager
The login plugin manager.

Namespace

Drupal\tfa

Code

public function getPlugins(array $configuration = []) {
  $plugin_ids = $this->tfaSettings
    ->get('login_plugins');
  $plugins = [];
  if (!empty($plugin_ids)) {
    foreach ($plugin_ids as $plugin_id) {
      $plugins[$plugin_id] = $this
        ->createInstance($plugin_id, $configuration);
    }
    return $plugins;
  }
  return NULL;
}