You are here

public function AuthenticationManager::addAuthenticationProvider in RESTful 7.2

Adds the auth provider to the list.

Parameters

string $plugin_id: The authentication plugin id.

Overrides AuthenticationManagerInterface::addAuthenticationProvider

1 call to AuthenticationManager::addAuthenticationProvider()
AuthenticationManager::addAllAuthenticationProviders in src/Authentication/AuthenticationManager.php
Adds all the auth providers to the list.

File

src/Authentication/AuthenticationManager.php, line 81
Contains \Drupal\restful\Authentication\AuthenticationManager

Class

AuthenticationManager
Class AuthenticationManager.

Namespace

Drupal\restful\Authentication

Code

public function addAuthenticationProvider($plugin_id) {
  $manager = AuthenticationPluginManager::create();
  $instance = $manager
    ->createInstance($plugin_id);

  // The get method will instantiate a plugin if not there.
  $this->plugins
    ->setInstanceConfiguration($plugin_id, $manager
    ->getDefinition($plugin_id));
  $this->plugins
    ->set($plugin_id, $instance);
}