You are here

public function OAuth2ServerAuthentication::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

src/Plugin/authentication/OAuth2ServerAuthentication.php, line 37

Class

OAuth2ServerAuthentication
Authentication support for oauth2_server.

Namespace

Drupal\restful\Plugin\authentication

Code

public function applies(RequestInterface $request) {
  return module_exists('oauth2_server') && $this
    ->getOAuth2Info($request);
}