You are here

public function TokenAuthentication::applies in RESTful 7.2

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.

Parameters

RequestInterface $request: The request.

Return value

bool TRUE if the request can be checked for authentication, FALSE otherwise.

Overrides Authentication::applies

File

modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php, line 31
Contains \Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication

Class

TokenAuthentication
Class TokenAuthentication @package Drupal\restful\Plugin\authentication

Namespace

Drupal\restful_token_auth\Plugin\authentication

Code

public function applies(RequestInterface $request) {
  return (bool) $this
    ->extractToken($request);
}