Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (23 sloc) 1.17 kb
HTTP_OAuth is a PEAR package implementing the OAuth 1.0a protocol.
Consumer, Provier (request and response) classes are provided.
See the Consumer examples below:
Main consumer class that assists consumers in establishing OAuth
creditials and making OAuth requests.
$consumer = new HTTP_OAuth_Consumer('key', 'secret');
$consumer->getRequestToken('', $callback);
// Store tokens
$_SESSION['token'] = $consumer->getToken();
$_SESSION['token_secret'] = $consumer->getTokenSecret();
$url = $consumer->getAuthorizeUrl('');
http_redirect($url); // function from pecl_http
// When they come back via the $callback url
$consumer = new HTTP_OAuth_Consumer('key', 'secret', $_SESSION['token'],
// Store tokens
$_SESSION['token'] = $consumer->getToken();
$_SESSION['token_secret'] = $consumer->getTokenSecret();
// $response is an instance of HTTP_OAuth_Consumer_Response
$response = $consumer->sendRequest('');
Jump to Line
Something went wrong with that request. Please try again.