TestAuthGlobal.php

Same filename and directory in other branches
  1. 9 core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php
  2. 8.9.x core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php
  3. 10 core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php

Namespace

Drupal\rest_test\Authentication\Provider

File

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

View source
<?php

declare (strict_types=1);
namespace Drupal\rest_test\Authentication\Provider;

use Drupal\Core\Authentication\AuthenticationProviderInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * Global authentication provider for testing purposes.
 */
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;
  }

}

Classes

Title Deprecated Summary
TestAuthGlobal Global authentication provider for testing purposes.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.