承接 xabbuh/oauth1-authentication 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

xabbuh/oauth1-authentication

Composer 安装命令:

composer require xabbuh/oauth1-authentication

包简介

OAuth1 authentication for the HTTPlug library

README 文档

README

Build Status Scrutinizer Code Quality

Sign PSR-7 requests using OAuth1 when using them with HTTPlug clients.

Installation

Install the OAuth1 integration using Composer:

$ composer require xabbuh/oauth1-authentication:^1.0

Usage

  1. Configure the request signer with your consumer key and secret:

    use ApiClients\Tools\Psr7\Oauth1\Definition\ConsumerKey;
    use ApiClients\Tools\Psr7\Oauth1\Definition\ConsumerSecret;
    use ApiClients\Tools\Psr7\Oauth1\RequestSigning\RequestSigner;
    
    $requestSigner = new RequestSigner(
        new ConsumerKey('consumer_key'),
        new ConsumerSecret('consumer_secret')
    );

    You can also optionally specify the hash algorithm to use. Read more about that in the api-clients/psr7-oauth1 documentation.

  2. Set up the OAuth1 authentication passing the configured request signer together with your access token and token secret:

    // ...
    use ApiClients\Tools\Psr7\Oauth1\Definition\AccessToken;
    use ApiClients\Tools\Psr7\Oauth1\Definition\TokenSecret;
    use Xabbuh\Http\Authentication\OAuth1;
    
    // ...
    
    $oauth = new OAuth1(
        $requestSigner,
        new AccessToken('access_token'),
        new TokenSecret('token_secret')
    );
  3. Use the configured authentication with the authentication plugin:

    // ...
    use Http\Discovery\HttpClientDiscovery;
    use Http\Client\Common\PluginClient;
    use Http\Client\Common\Plugin\AuthenticationPlugin;
    
    // ...
    
    $authenticationPlugin = new AuthenticationPlugin($oauth);
    
    $pluginClient = new PluginClient(
        HttpClientDiscovery::find(),
        [$authenticationPlugin]
    );

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固