You are here

public function ApiKeyAuth::applies in Services API Key Authentication 2.0.x

Same name and namespace in other branches
  1. 8.2 src/Authentication/Provider/ApiKeyAuth.php \Drupal\services_api_key_auth\Authentication\Provider\ApiKeyAuth::applies()
  2. 8 src/Authentication/Provider/ApiKeyAuth.php \Drupal\services_api_key_auth\Authentication\Provider\ApiKeyAuth::applies()
  3. 3.0.x src/Authentication/Provider/ApiKeyAuth.php \Drupal\services_api_key_auth\Authentication\Provider\ApiKeyAuth::applies()

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/ApiKeyAuth.php, line 54

Class

ApiKeyAuth
HTTP Basic authentication provider.

Namespace

Drupal\services_api_key_auth\Authentication\Provider

Code

public function applies(Request $request) {

  // Only apply this validation if request has a valid accept value.
  return $this
    ->getKey($request) !== FALSE;
}