public function OAuth2ServerRestfulAuthentication::applies in OAuth2 Server 7
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
array $request: The request.
string $method: The HTTP method. Defaults to "get".
Return value
bool TRUE if the request can be checked for authentication, FALSE otherwise.
Overrides RestfulAuthenticationBase::applies
File
- plugins/
authentication/ OAuth2ServerRestfulAuthentication.class.php, line 35 - Contains RestfulOAuth2Authentication and OAuth2ServerRestfulException.
Class
- OAuth2ServerRestfulAuthentication
- A simple OAuth2 authentication type.
Code
public function applies(array $request = array(), $method = \RestfulInterface::GET) {
// Don't attempt to authenticate during a Drush call, for example registry
// rebuild.
// @todo perhaps this should be a patch upstream (for the restful module)
if (drupal_is_cli()) {
return FALSE;
}
return parent::applies($request, $method);
}