PHPackages                             djchen/oauth1-php - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. djchen/oauth1-php

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

djchen/oauth1-php
=================

A simple and easy to use OAuth1 library for PHP

522.4k↓35.2%2PHP

Since Jun 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/djchen/oauth1-php)[ Packagist](https://packagist.org/packages/djchen/oauth1-php)[ RSS](/packages/djchen-oauth1-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

oauth1-php
==========

[](#oauth1-php)

---

oauth1-php is a super simple and basic PHP library for making OAuth 1.0 requests.

\###Install with Composer

```
{
  "require" : {
    "djchen/oauth1-php" : "dev-master"
  },
  "autoload": {
    "psr-0": {"djchen": "src"}
  }
}
```

\###Dependecies Requires PHP 5.3+ and cURL The Unirest library is used to make HTTP requests and is included in the project.

\##Usage ###Initializing

```
$oauth = new OAuth1(array(
        'consumerKey' => 'oauth_consumer_key',
        'consumerSecret' => 'oauth_consumer_secret',
        'token' => 'oauth_token', // optional
        'tokenSecret' => 'oauth_token_secret', // optional
        'requestTokenUrl' => 'request_token_url',
        'accessTokenUrl' => 'access_token_url',
));
```

\###Getting a request token

```
$result = $oauth->requestToken('callback_url');
```

$result is an array with the response params =&gt; values

\###Getting an access token

```
$result = $oauth->accessToken('oauth_token', 'oauth_token_secret', 'oauth_verifier');
```

$result is an array with the response params =&gt; values

\###Making API calls

```
$response = $oauth->get($url, $params = array(), $httpHeaders = array(), $oauthParams = array());
$response = $oauth->post($url, $body = null, $httpHeaders = array(), $oauthParams = array());
$response = $oauth->put($url, $body = null, $httpHeaders = array(), $oauthParams = array());
$response = $oauth->delete($url, $body = null, $httpHeaders = array(), $oauthParams = array());
```

The $response is an object with these fields

```
$response->code; // HTTP Response Status Code
$response->headers; // HTTP Response Headers
$response->body; // Parsed response body where applicable, for example JSON responses are parsed to Objects / Associative Arrays.
$response->raw_body; // Original un-parsed response body
```

Debug mode can be turned on via `$oauth->setDebug(true)`. This will log both request headers and response headers and body.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab950dcd6a23e5e5b9f70b61184538a03e7a216bb1ff0723f6d817f531bea714?d=identicon)[djchen](/maintainers/djchen)

---

Top Contributors

[![djchen](https://avatars.githubusercontent.com/u/826556?v=4)](https://github.com/djchen "djchen (5 commits)")

### Embed Badge

![Health badge](/badges/djchen-oauth1-php/health.svg)

```
[![Health](https://phpackages.com/badges/djchen-oauth1-php/health.svg)](https://phpackages.com/packages/djchen-oauth1-php)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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