You are here

class TestAuthGlobal in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php \Drupal\rest_test\Authentication\Provider\TestAuthGlobal
  2. 10 core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php \Drupal\rest_test\Authentication\Provider\TestAuthGlobal

Global authentication provider for testing purposes.

Hierarchy

Expanded class hierarchy of TestAuthGlobal

1 string reference to 'TestAuthGlobal'
rest_test.services.yml in core/modules/rest/tests/modules/rest_test/rest_test.services.yml
core/modules/rest/tests/modules/rest_test/rest_test.services.yml
1 service uses TestAuthGlobal
rest_test.authentication.test_auth_global in core/modules/rest/tests/modules/rest_test/rest_test.services.yml
Drupal\rest_test\Authentication\Provider\TestAuthGlobal

File

core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php, line 11

Namespace

Drupal\rest_test\Authentication\Provider
View source
class TestAuthGlobal implements AuthenticationProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function applies(Request $request) {
    return $request->headers
      ->has('REST-test-auth-global');
  }

  /**
   * {@inheritdoc}
   */
  public function authenticate(Request $request) {
    return NULL;
  }

}

Members

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