2017 © Pedro Peláez
 

library oauth1-authentication

OAuth1 authentication for the HTTPlug library

image

xabbuh/oauth1-authentication

OAuth1 authentication for the HTTPlug library

  • Wednesday, April 25, 2018
  • by xabbuh
  • Repository
  • 1 Watchers
  • 6 Stars
  • 196 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 47 % Grown

The README.md

OAuth1 Authentication for HTTPlug

Build Status Scrutinizer Code Quality, (*1)

Sign PSR-7 requests using OAuth1 when using them with HTTPlug clients., (*2)

Installation

Install the OAuth1 integration using Composer:, (*3)

$ composer require xabbuh/oauth1-authentication:^1.0

Usage

  1. Configure the request signer with your consumer key and secret:, (*4)

    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., (*5)

  2. Set up the OAuth1 authentication passing the configured request signer together with your access token and token secret:, (*6)

    // ...
    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:, (*7)

    // ...
    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]
    );
    

The Versions

25/04 2018

dev-master

9999999-dev https://github.com/xabbuh/oauth1-authentication

OAuth1 authentication for the HTTPlug library

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin authentication oauth security http oauth1 httplug

25/04 2018

dev-php-support

dev-php-support https://github.com/xabbuh/oauth1-authentication

OAuth1 authentication for the HTTPlug library

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin authentication oauth security http oauth1 httplug

01/01 2017

v1.0.0

1.0.0.0 https://github.com/xabbuh/oauth1-authentication

OAuth1 authentication for the HTTPlug library

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin authentication oauth security http oauth1 httplug