RestResourceConfig::getAuthenticationProviders

public RestResourceConfig::getAuthenticationProviders($method)

Retrieves a list of supported authentication providers.

Parameters

string $method: The request method e.g GET or POST.

Return value

string[] A list of supported authentication provider IDs.

Overrides RestResourceConfigInterface::getAuthenticationProviders

File

core/modules/rest/src/Entity/RestResourceConfig.php, line 141

Class

RestResourceConfig
Defines a RestResourceConfig configuration entity class.

Namespace

Drupal\rest\Entity

Code

public function getAuthenticationProviders($method) {
  switch ($this->granularity) {
    case RestResourceConfigInterface::METHOD_GRANULARITY:
      return $this->getAuthenticationProvidersForMethodGranularity($method);
    case RestResourceConfigInterface::RESOURCE_GRANULARITY:
      return $this->configuration['authentication'];
    default:
      throw new \InvalidArgumentException('Invalid granularity specified.');
  }
}
doc_Drupal
2016-10-29 09:38:19
Comments
Leave a Comment

Please login to continue.