PHPackages                             guzzlehttp/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. guzzlehttp/oauth-subscriber

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

guzzlehttp/oauth-subscriber
===========================

Guzzle OAuth 1.0 subscriber

0.8.1(1y ago)24114.5M—6.1%88[5 issues](https://github.com/guzzle/oauth-subscriber/issues)20MITPHPPHP ^7.2.5 || ^8.0CI passing

Since Mar 16Pushed 1y ago13 watchersCompare

[ Source](https://github.com/guzzle/oauth-subscriber)[ Packagist](https://packagist.org/packages/guzzlehttp/oauth-subscriber)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ GitHub Sponsors](https://github.com/Nyholm)[ RSS](/packages/guzzlehttp-oauth-subscriber/feed)WikiDiscussions 0.8 Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (16)Used By (20)Security (1)

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 works with Guzzle 7.9+ and PHP 7.2.5+.

Installing
----------

[](#installing)

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

```
{
    "require": {
        "guzzlehttp/oauth-subscriber": "^0.8"
    }
}
```

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');
```

You can set the `token` and `token_secret` options to an empty string 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('https://httpbin.org/', ['auth' => 'oauth']);
```

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance41

Moderate activity, may be stable

Popularity67

Solid adoption and visibility

Community49

Growing community involvement

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~306 days

Recently: every ~7 days

Total

14

Last Release

467d ago

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

0.3.0PHP &gt;=5.5.0

0.7.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/190930?v=4)[Michael Dowling](/maintainers/mtdowling)[@mtdowling](https://github.com/mtdowling)

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (32 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (23 commits)")[![casperbakker](https://avatars.githubusercontent.com/u/886975?v=4)](https://github.com/casperbakker "casperbakker (14 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (6 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (4 commits)")[![matthewpeach](https://avatars.githubusercontent.com/u/1046921?v=4)](https://github.com/matthewpeach "matthewpeach (2 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (2 commits)")[![jrmadsen67](https://avatars.githubusercontent.com/u/821958?v=4)](https://github.com/jrmadsen67 "jrmadsen67 (1 commits)")[![juampynr](https://avatars.githubusercontent.com/u/108130?v=4)](https://github.com/juampynr "juampynr (1 commits)")[![nickdnk](https://avatars.githubusercontent.com/u/8411314?v=4)](https://github.com/nickdnk "nickdnk (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)")[![andreybolonin](https://avatars.githubusercontent.com/u/2576509?v=4)](https://github.com/andreybolonin "andreybolonin (1 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (1 commits)")[![ashgibson](https://avatars.githubusercontent.com/u/1744544?v=4)](https://github.com/ashgibson "ashgibson (1 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (1 commits)")[![cerpusoddarne](https://avatars.githubusercontent.com/u/28703438?v=4)](https://github.com/cerpusoddarne "cerpusoddarne (1 commits)")[![ferdypruis](https://avatars.githubusercontent.com/u/1174981?v=4)](https://github.com/ferdypruis "ferdypruis (1 commits)")[![jalvarado91](https://avatars.githubusercontent.com/u/1750392?v=4)](https://github.com/jalvarado91 "jalvarado91 (1 commits)")[![jhoopes](https://avatars.githubusercontent.com/u/3297518?v=4)](https://github.com/jhoopes "jhoopes (1 commits)")

---

Tags

Guzzleoauth

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[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)[graham-campbell/guzzle-factory

Provides A Simple Guzzle Factory With Good Defaults

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

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[kamermans/guzzle-oauth2-subscriber

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

1516.7M54](/packages/kamermans-guzzle-oauth2-subscriber)[gmponos/guzzle_logger

A Guzzle middleware to log request and responses automatically

772.2M6](/packages/gmponos-guzzle-logger)[rtheunissen/guzzle-rate-limiter

Guzzle 6 middleware used to delay requests dynamically

52177.2k1](/packages/rtheunissen-guzzle-rate-limiter)

PHPackages © 2026

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