Files
unirest-php/main/mashape/authentication/OAuth2Authentication.php
2012-10-11 15:25:28 -07:00

20 lines
531 B
PHP

<?php
require_once(dirname(__FILE__) . "/OAuthAuthentication.php");
class OAuth2Authentication extends OAuthAuthentication {
function __construct($consumerKey, $consumerSecret, $callbackUrl) {
parent::__construct($consumerKey, $consumerSecret, $callbackUrl);
}
public function handleParams() {
if ($this->accessToken == null) {
throw new MashapeClientException(
EXCEPTION_OAUTH2_AUTHORIZE,
EXCEPTION_OAUTH2_AUTHORIZE_CODE);
}
$params = array("accesstoken" => $this->accessToken);
return $params;
}
}
?>