定制 befool-inc/http_oauth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

befool-inc/http_oauth

Composer 安装命令:

composer require befool-inc/http_oauth

包简介

HTTP_OAuth package contains the basics for both OAuth consumers and providers.

关键字:

README 文档

README

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:


HTTP_OAuth_Consumer

Main consumer class that assists consumers in establishing OAuth
creditials and making OAuth requests.

Example:

$consumer = new HTTP_OAuth_Consumer('key', 'secret');
$consumer->getRequestToken('http://example.com/oauth/request_token', $callback);

// Store tokens
$_SESSION['token']        = $consumer->getToken();
$_SESSION['token_secret'] = $consumer->getTokenSecret();

$url = $consumer->getAuthorizeUrl('http://example.com/oauth/authorize');
http_redirect($url); // function from pecl_http

// When they come back via the $callback url
$consumer = new HTTP_OAuth_Consumer('key', 'secret', $_SESSION['token'],
    $_SESSION['token_secret']);
$consumer->getAccessToken('http://example.com/oauth/access_token');

// Store tokens
$_SESSION['token']        = $consumer->getToken();
$_SESSION['token_secret'] = $consumer->getTokenSecret();

// $response is an instance of HTTP_OAuth_Consumer_Response
$response = $consumer->sendRequest('http://example.com/oauth/protected_resource');

统计信息

  • 总下载量: 13.57k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-12-02