You are here

public function W3CTokenAuth::applies in W3C Validator 8

Checks whether suitable authentication credentials are on the request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

bool TRUE if authentication credentials suitable for this provider are on the request, FALSE otherwise.

Overrides AuthenticationProviderInterface::applies

File

src/Authentication/Provider/W3CTokenAuth.php, line 46

Class

W3CTokenAuth
Oauth authentication provider.

Namespace

Drupal\w3c_validator\Authentication\Provider

Code

public function applies(Request $request) {

  // Only check requests with the 'authorization' header starting with OAuth.
  $token = $request->query
    ->get('HTTP_W3C_VALIDATOR_TOKEN');
  return isset($token);
}