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

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

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

		$result = $db->loadObject();

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

		if (empty($result)) // token not found
		{
			return OAUTH_TOKEN_REJECTED;
		}

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

		if ($result->user_id == '0') // check verifier on request tokens
		{
			if ($result->verifier != $this->_provider->verifier)
			{
				return OAUTH_VERIFIER_INVALID;
			}
		}

		$this->_token_data = $result;
		$this->_provider->token_secret = $result->token_secret;

		return OAUTH_OK;
	}
public function tokenHandler()
	{
		$db = \App::get('db');

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

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

		$result = $db->loadObject();

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

		if (empty($result)) // token not found
		{
			return OAUTH_TOKEN_REJECTED;
		}

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

		if ($result->user_id == '0') // check verifier on request tokens
		{
			if ($result->verifier != $this->_provider->verifier)
			{
				return OAUTH_VERIFIER_INVALID;
			}
		}

		$this->_token_data = $result;
		$this->_provider->token_secret = $result->token_secret;

		return OAUTH_OK;
	}
public function tokenHandler ( ) { $ db = \ App :: get ( 'db' ) ; if ( ! is_object ( $ db ) ) { return OAUTH_ERR_INTERNAL_ERROR ; } $ db -> setQuery ( "SELECT * FROM `#__oauthp_tokens` WHERE token=" . $ db -> quote ( $ this -> _provider -> token ) . " LIMIT 1;" ) ; $ result = $ db -> loadObject ( ) ; if ( $ result === false ) // query failed { return OAUTH_ERR_INTERNAL_ERROR ; } if ( empty ( $ result ) ) // token not found { return OAUTH_TOKEN_REJECTED ; } if ( $ result -> state != '1' ) // token not in a valid state { return OAUTH_TOKEN_REJECTED ; } if ( $ result -> user_id == '0' ) // check verifier on request tokens { if ( $ result -> verifier != $ this -> _provider -> verifier ) { return OAUTH_VERIFIER_INVALID ; } } $ this -> _token_data = $ result ; $ this -> _provider -> token_secret = $ result -> token_secret ; return OAUTH_OK ; }
OAuthProvider tokenHandler Callback

Lookup token data associated with OAuthProvider instance

If token is valid stores full token record in _token_data property

@return  OAUTH_OK on success
If token not found returns OAUTH_TOKEN_REJECTED
If token has expired or is otherwise unusable returns OAUTH_TOKEN_REJECTED
If request verifier doesn't match token's verifier returns OAUTH_VERIFIER_INVALID
If lookup process failed for some reason returns OAUTH_ERR_INTERNAL_ERROR
OAuthProvider tokenHandler Callback