Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Authentication/AuthenticationProviderInterface.php \Drupal\Core\Authentication\AuthenticationProviderInterface
  2. 9 core/lib/Drupal/Core/Authentication/AuthenticationProviderInterface.php \Drupal\Core\Authentication\AuthenticationProviderInterface

Interface for authentication providers.

Hierarchy

Expanded class hierarchy of AuthenticationProviderInterface

All classes that implement AuthenticationProviderInterface

7 files declare their use of AuthenticationProviderInterface
Auth.php in core/modules/locale/tests/modules/early_translation_test/src/Auth.php
AuthenticationCollectorTest.php in core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php
AuthenticationManagerTest.php in core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
AuthenticationSubscriber.php in core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php
Cookie.php in core/modules/user/src/Authentication/Provider/Cookie.php

... See full list

File

core/lib/Drupal/Core/Authentication/AuthenticationProviderInterface.php, line 10

Namespace

Drupal\Core\Authentication
View source
interface AuthenticationProviderInterface {

  /**
   * Checks whether suitable authentication credentials are on the request.
   *
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The request object.
   *
   * @return bool
   *   TRUE if authentication credentials suitable for this provider are on the
   *   request, FALSE otherwise.
   */
  public function applies(Request $request);

  /**
   * Authenticates the user.
   *
   * @param \Symfony\Component\HttpFoundation\Request|null $request
   *   The request object.
   *
   * @return \Drupal\Core\Session\AccountInterface|null
   *   AccountInterface - in case of a successful authentication.
   *   NULL - in case where authentication failed.
   */
  public function authenticate(Request $request);

}

Members

Namesort descending Modifiers Type Description Overrides
AuthenticationProviderInterface::applies public function Checks whether suitable authentication credentials are on the request.
AuthenticationProviderInterface::authenticate public function Authenticates the user.