Proposal for "HTTP_OAuthProvider"

» Metadata » Status
  • Status: Proposed
» Description
Service provider's library to authenticate OAuth request.

Protocol are:
* 2Legged OAuth
* 3Legged OAuth
* Verify a request from opensocial provider

Signature method are:
* HMAC-SHA1
* RSA-SHA1

Token store method are:
* Cache_Lite
* Memcached
* Memcache

Example:

<?php
require_once('HTTP/OAuthProvider.php');

$o = new HTTP_OAuthProvider();
try {
$o->setFetchConsumerHandler('fetchConsumer');
$o->authenticate();

echo "Auth OK!!!\n";
printf("consumer: %s\n", $o->getConsumer()->getKey());

} catch (Exception $e) {
header(sprintf('HTTP/1.0 %d', $e->getCode()));
echo $e->getMessage();
}

// consumer
function fetchConsumer($consumer_key)
{
$row = array(
'id' => 1,
'key' => 'testconsumer',
'secret' => 'testpass',
'publickey' => ''
);
if ($consumer_key==$row['key']) {
$consumer = new HTTP_OAuthProvider_Consumer($row);
return $consumer;
}
}
» Dependencies » Links
  • Cache_Lite
» Timeline » Changelog
  • First Draft: 2010-08-21
  • Proposal: 2010-09-25