PHPackages                             nilesuan/oauth2-thirtysevensignals - 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. nilesuan/oauth2-thirtysevensignals

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

nilesuan/oauth2-thirtysevensignals
==================================

37signals OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1.0.3(9y ago)11461[1 issues](https://github.com/nilesuan/oauth2-thirtysevensignals/issues)MITPHPPHP &gt;=5.5.0

Since Aug 21Pushed 9y ago2 watchersCompare

[ Source](https://github.com/nilesuan/oauth2-thirtysevensignals)[ Packagist](https://packagist.org/packages/nilesuan/oauth2-thirtysevensignals)[ RSS](/packages/nilesuan-oauth2-thirtysevensignals/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

37signals Provider for OAuth 2.0 Client
=======================================

[](#37signals-provider-for-oauth-20-client)

[![Latest Version](https://camo.githubusercontent.com/49437b9e7d2d97662d23559e5f7a7a5f3417a08973ab6045155e5837ad0739a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e696c657375616e2f6f61757468322d746869727479736576656e7369676e616c732e7376673f7374796c653d666c61742d737175617265)](https://github.com/nilesuan/oauth2-thirtysevensignals/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/039e6c21eed4be2e33c6fe975bdfbe5ac689ff62a2144dbc6021dc9397995183/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e696c657375616e2f6f61757468322d746869727479736576656e7369676e616c732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/nilesuan/oauth2-thirtysevensignals)[![Coverage Status](https://camo.githubusercontent.com/e1f8cf13645f1ce9eada0db9f92bdc58f58d77eb94f934bbe4c67a997016c549/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6e696c657375616e2f6f61757468322d746869727479736576656e7369676e616c732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nilesuan/oauth2-thirtysevensignals/code-structure)[![Quality Score](https://camo.githubusercontent.com/2a5c6fea92194c34f6a216753c1961dca111726580617a5e2f3d2fdfb3ce3f07/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e696c657375616e2f6f61757468322d746869727479736576656e7369676e616c732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nilesuan/oauth2-thirtysevensignals)[![Total Downloads](https://camo.githubusercontent.com/fe2c3797dfa330175f1ae0e5e32dd1e63a1224034a037c2a7bb8929593bff7c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e696c657375616e2f6f61757468322d746869727479736576656e7369676e616c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nilesuan/oauth2-thirtysevensignals)

This package provides 37signals OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Installation
------------

[](#installation)

To install, use composer:

```
composer require nilesuan/oauth2-thirtysevensignals

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\nilesuan\OAuth2\Client\Provider\thirtysevensignals` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new nilesuan\OAuth2\Client\Provider\thirtysevensignals([
    'clientId'          => '{thirtysevensignals-client-id}',
    'clientSecret'      => '{thirtysevensignals-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

if (!isset($_GET['code'])) {

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    header('Location: '.$authUrl);
    exit;

// Check given state against previously stored one to mitigate CSRF attack
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

    unset($_SESSION['oauth2state']);
    exit('Invalid state');

} else {

    // Try to get an access token (using the authorization code grant)
    $token = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    // Optional: Now you have a token you can look up a users profile data
    try {

        // We got an access token, let's now get the user's details
        $user = $provider->getResourceOwner($token);

        // Use these details to create a new profile
        printf('Hello %s!', $user->getId());

    } catch (Exception $e) {

        // Failed to get user details
        exit('Oh dear...');
    }

    // Use this to interact with an API on the users behalf
    echo $token->getToken();
}
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/nilesuan/oauth2-thirtysevensignals/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Nile Suan](https://github.com/nilesuan)
- [All Contributors](https://github.com/nilesuan/oauth2-thirtysevensignals/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/nilesuan/oauth2-thirtysevensignals/blob/master/LICENSE) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~59 days

Total

2

Last Release

3541d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4256888?v=4)[Nile Suan](/maintainers/nilesuan)[@nilesuan](https://github.com/nilesuan)

---

Top Contributors

[![nilesuan](https://avatars.githubusercontent.com/u/4256888?v=4)](https://github.com/nilesuan "nilesuan (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationthirtysevensignals

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/nilesuan-oauth2-thirtysevensignals/health.svg)

```
[![Health](https://phpackages.com/badges/nilesuan-oauth2-thirtysevensignals/health.svg)](https://phpackages.com/packages/nilesuan-oauth2-thirtysevensignals)
```

###  Alternatives

[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2306.4M37](/packages/stevenmaguire-oauth2-keycloak)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

25310.7M73](/packages/thenetworg-oauth2-azure)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1152.7M11](/packages/patrickbussmann-oauth2-apple)[omines/oauth2-gitlab

GitLab OAuth 2.0 Client Provider for The PHP League OAuth2-Client

36779.2k16](/packages/omines-oauth2-gitlab)[league/oauth2-instagram

Instagram OAuth 2.0 Client Provider for The PHP League OAuth2-Client

661.1M44](/packages/league-oauth2-instagram)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

261.8M1](/packages/mollie-oauth2-mollie-php)

PHPackages © 2026

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