OAuth 1.0 (rfc5849) PHP 5.3
Craig Mason < craig.mason@stasismedia.com >
A PHP 5.3+ only implementation of the OAuth 1.0 protocol http://tools.ietf.org/html/rfc5849
This library does not handle the creation of CURL or other HTTP connections. It will generate signatures and "Authorization: OAuth" headers which can then be easily used in a CURL or Socket connection.
The library does not store any keys, tokens or secrets. That responsibility lives with the application.
Example
use StasisMediaOAuth;
$consumerCredential = new OAuthCredentialConsumer('key', 'secret');
$request = new OAuthRequestRequestToken($consumerCredential, 'http://example.com/request_token');
$signature = new OAuthSignatureHMAC_SHA1($request, $consumerCredential);
$authHeader = $request->getAuthorizationHeader('realm', $signature->generateSignature() );
echo $authHeader;
/*
* Authorization: OAuth realm="realm", oauth_consumer_key="key",
* oauth_timestamp="1288534693", oauth_nonce="b0d75745b33346972e8cab2129f33bb5",
* oauth_version="1.0", oauth_signature_method="HMAC-SHA1",
* oauth_signature="%2B7mFGdwyRvMdQR1o%2FxJqyBcscpE%3D"
*/
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。