public function consumerHandler()
	{
		$db = \App::get('db');

		if (!is_object($db))
		{
			return OAUTH_ERR_INTERNAL_ERROR;
		}

		$db->setQuery("SELECT * FROM `#__oauthp_consumers` WHERE token=" . $db->quote($this->_provider->consumer_key) . " LIMIT 1;");

		$result = $db->loadObject();

		if ($result === false)	// query failed
		{
			return OAUTH_ERR_INTERNAL_ERROR;
		}

		if (empty($result)) // key not found
		{
			return OAUTH_CONSUMER_KEY_UNKNOWN;
		}

		if ($result->state != 1) // key not in a valid state
		{
			return OAUTH_CONSUMER_KEY_REFUSED;
		}

		$this->_consumer_data = $result;
		$this->_provider->consumer_secret = $result->secret;

		return OAUTH_OK;
	}