You are here

function hook_services_api_key_valid_alter in Services API Key Authentication 7

Alter whether the API key is considered valid or not, before the access callback returns. This allows you to add your own logic to the callback.

Parameters

&$valid: Boolean showing whether the API key is already considered valid.

&$args: Array of arguments passed to the access callback. Can be useful for context.

1 invocation of hook_services_api_key_valid_alter()
services_api_key_auth_services_authenticate in ./services_api_key_auth.module
Apply authentication rules.

File

./services_api_key_auth.api.php, line 18
Documents Services API Key Authentication's hooks for API reference.

Code

function hook_services_api_key_valid_alter(&$valid, &$args) {
  if (arg(0) === 'xyz-rest' && arg(1) === 'allow-everyone') {
    $valid = TRUE;
  }
}