You are here

abstract class Authentication in RESTful 7.2

Same name in this branch
  1. 7.2 src/Annotation/Authentication.php \Drupal\restful\Annotation\Authentication
  2. 7.2 src/Plugin/authentication/Authentication.php \Drupal\restful\Plugin\authentication\Authentication

Hierarchy

Expanded class hierarchy of Authentication

1 file declares its use of Authentication
TokenAuthentication.php in modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
Contains \Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication
1 string reference to 'Authentication'
RestfulAuthenticationTestCase::getInfo in tests/RestfulAuthenticationTestCase.test

File

src/Plugin/authentication/Authentication.php, line 15
Contains \Drupal\restful\Plugin\authentication\Authentication

Namespace

Drupal\restful\Plugin\authentication
View source
abstract class Authentication extends PluginBase implements ConfigurablePluginInterface, AuthenticationInterface {
  use ConfigurablePluginTrait;

  /**
   * Token value for token generation functions.
   */
  const TOKEN_VALUE = 'rest';

  /**
   * Settings from the plugin definition.
   *
   * @var array
   */
  protected $settings;

  /**
   * {@inheritdoc}
   */
  public function applies(RequestInterface $request) {

    // By default assume that the request can be checked for authentication.
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function getName() {
    return $this
      ->getPluginId();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Authentication::$settings protected property Settings from the plugin definition.
Authentication::applies public function Determines if the request can be checked for authentication. For example, when authenticating with HTTP header, return FALSE if the header values do not exist. Overrides AuthenticationInterface::applies 3
Authentication::getName public function Get the name of the authentication plugin. Overrides AuthenticationInterface::getName
Authentication::TOKEN_VALUE constant Token value for token generation functions.
AuthenticationInterface::authenticate public function Authenticate the request by trying to match a user. 4
ConfigurablePluginTrait::$instanceConfiguration protected property Plugin instance configuration.
ConfigurablePluginTrait::calculateDependencies public function
ConfigurablePluginTrait::defaultConfiguration public function 1
ConfigurablePluginTrait::getConfiguration public function
ConfigurablePluginTrait::setConfiguration public function