private function OAuthServer::get_consumer in OAuth 1.0 7.3
Same name and namespace in other branches
- 6.3 lib/OAuth.php \OAuthServer::get_consumer()
- 6 OAuth.php \OAuthServer::get_consumer()
try to find the consumer for the provided request's consumer key
3 calls to OAuthServer::get_consumer()
- OAuthServer::fetch_access_token in lib/
OAuth.php - process an access_token request returns the access token on success
- OAuthServer::fetch_request_token in lib/
OAuth.php - process a request_token request returns the request token on success
- OAuthServer::verify_request in lib/
OAuth.php - verify an api call, checks all the parameters
File
- lib/
OAuth.php, line 625 - OAuth 1.0 server and client library.
Class
Code
private function get_consumer($request) {
$consumer_key = $request instanceof OAuthRequest ? $request
->get_parameter("oauth_consumer_key") : NULL;
if (!$consumer_key) {
throw new OAuthException("Invalid consumer key");
}
$consumer = $this->data_store
->lookup_consumer($consumer_key);
if (!$consumer) {
throw new OAuthException("Invalid consumer");
}
return $consumer;
}