PHPackages                             jojihere/oauth-subscriber - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. jojihere/oauth-subscriber

ActiveLibrary[HTTP &amp; Networking](/categories/http)

jojihere/oauth-subscriber
=========================

Guzzle OAuth 1.0 subscriber

0.3.1(9y ago)0182MITPHPPHP &gt;=5.5.0

Since Mar 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mojojoji/oauth-subscriber)[ Packagist](https://packagist.org/packages/jojihere/oauth-subscriber)[ Docs](http://guzzlephp.org/)[ RSS](/packages/jojihere-oauth-subscriber/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (8)Used By (0)

Guzzle OAuth Subscriber
=======================

[](#guzzle-oauth-subscriber)

Signs HTTP requests using OAuth 1.0. Requests are signed using a consumer key, consumer secret, OAuth token, and OAuth secret.

This version only works with Guzzle 6.0 and up!

Installing
----------

[](#installing)

This project can be installed using Composer. Add the following to your composer.json:

```
{
    "require": {
        "guzzlehttp/oauth-subscriber": "0.3.*"
    }
}
```

Using the Subscriber
--------------------

[](#using-the-subscriber)

Here's an example showing how to send an authenticated request to the Twitter REST API:

```
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Subscriber\Oauth\Oauth1;

$stack = HandlerStack::create();

$middleware = new Oauth1([
    'consumer_key'    => 'my_key',
    'consumer_secret' => 'my_secret',
    'token'           => 'my_token',
    'token_secret'    => 'my_token_secret'
]);
$stack->push($middleware);

$client = new Client([
    'base_uri' => 'https://api.twitter.com/1.1/',
    'handler' => $stack
]);

// Set the "auth" request option to "oauth" to sign using oauth
$res = $client->get('statuses/home_timeline.json', ['auth' => 'oauth']);
```

You can set the `auth` request option to `oauth` for all requests sent by the client by extending the array you feed to `new Client` with auth =&gt; oauth.

```
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Subscriber\Oauth\Oauth1;

$stack = HandlerStack::create();

$middleware = new Oauth1([
    'consumer_key'    => 'my_key',
    'consumer_secret' => 'my_secret',
    'token'           => 'my_token',
    'token_secret'    => 'my_token_secret'
]);
$stack->push($middleware);

$client = new Client([
    'base_uri' => 'https://api.twitter.com/1.1/',
    'handler' => $stack,
    'auth' => 'oauth'
]);

// Now you don't need to add the auth parameter
$res = $client->get('statuses/home_timeline.json');
```

Note

You can omit the token and token\_secret options to use two-legged OAuth.

Using the RSA-SH1 signature method
----------------------------------

[](#using-the-rsa-sh1-signature-method)

```
use GuzzleHttp\Subscriber\Oauth\Oauth1;

$stack = HandlerStack::create();

$middleware = new Oauth1([
    'consumer_key'    => 'my_key',
    'consumer_secret' => 'my_secret',
    'private_key_file' => 'my_path_to_private_key_file',
    'private_key_passphrase' => 'my_passphrase',
    'signature_method' => Oauth1::SIGNATURE_METHOD_RSA,
]);
$stack->push($middleware);

$client = new Client([
    'handler' => $stack
]);

$response = $client->get('http://httpbin.org', ['auth' => 'oauth']);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~196 days

Recently: every ~241 days

Total

6

Last Release

3459d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

0.3.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c4abbba41b454044950c6fb3b8318f43f598d56ebdcd5d0a015303d014b15f4?d=identicon)[jojihere](/maintainers/jojihere)

---

Top Contributors

[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (32 commits)")[![casperbakker](https://avatars.githubusercontent.com/u/886975?v=4)](https://github.com/casperbakker "casperbakker (14 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (6 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (2 commits)")[![matthewpeach](https://avatars.githubusercontent.com/u/1046921?v=4)](https://github.com/matthewpeach "matthewpeach (2 commits)")[![mojojoji](https://avatars.githubusercontent.com/u/718969?v=4)](https://github.com/mojojoji "mojojoji (2 commits)")[![jalvarado91](https://avatars.githubusercontent.com/u/1750392?v=4)](https://github.com/jalvarado91 "jalvarado91 (1 commits)")[![ragboyjr](https://avatars.githubusercontent.com/u/1975857?v=4)](https://github.com/ragboyjr "ragboyjr (1 commits)")[![siwinski](https://avatars.githubusercontent.com/u/1034024?v=4)](https://github.com/siwinski "siwinski (1 commits)")

---

Tags

Guzzleoauth

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jojihere-oauth-subscriber/health.svg)

```
[![Health](https://phpackages.com/badges/jojihere-oauth-subscriber/health.svg)](https://phpackages.com/packages/jojihere-oauth-subscriber)
```

###  Alternatives

[guzzlehttp/oauth-subscriber

Guzzle OAuth 1.0 subscriber

24114.5M141](/packages/guzzlehttp-oauth-subscriber)[kevinrob/guzzle-cache-middleware

A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)

43117.4M104](/packages/kevinrob-guzzle-cache-middleware)[kamermans/guzzle-oauth2-subscriber

OAuth 2.0 client for Guzzle 4, 5, 6 and 7+

1516.7M54](/packages/kamermans-guzzle-oauth2-subscriber)[caseyamcl/guzzle_retry_middleware

Guzzle v6+ retry middleware that handles 429/503 status codes and connection timeouts

21610.7M64](/packages/caseyamcl-guzzle-retry-middleware)[php-http/guzzle7-adapter

Guzzle 7 HTTP Adapter

9057.1M555](/packages/php-http-guzzle7-adapter)[graham-campbell/guzzle-factory

Provides A Simple Guzzle Factory With Good Defaults

916.4M49](/packages/graham-campbell-guzzle-factory)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
