PHPackages                             netliferesearch/oauth2-twist - 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. netliferesearch/oauth2-twist

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

netliferesearch/oauth2-twist
============================

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

1.0.1(8y ago)022MITPHP

Since Oct 27Pushed 8y ago11 watchersCompare

[ Source](https://github.com/netliferesearch/oauth2-twist)[ Packagist](https://packagist.org/packages/netliferesearch/oauth2-twist)[ RSS](/packages/netliferesearch-oauth2-twist/feed)WikiDiscussions master Synced 2w ago

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

Twist Provider for OAuth 2.0 Client
===================================

[](#twist-provider-for-oauth-20-client)

This package provides Twist 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 netliferesearch/oauth2-twist

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

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

For further usage of this package please refer to the [core package documentation on "Authorization Code Grant"](https://github.com/thephpleague/oauth2-client#usage).

### Refreshing a Token

[](#refreshing-a-token)

Once your application is authorized, you can refresh an expired token using a refresh token rather than going through the entire process of obtaining a brand new token. To do so, simply reuse this refresh token from your data store to request a refresh.

```
$existingAccessToken = getAccessTokenFromYourDataStore();

if ($existingAccessToken->hasExpired()) {
    $newAccessToken = $provider->getAccessToken('refresh_token', [
        'refresh_token' => $existingAccessToken->getRefreshToken()
    ]);

    // Purge old access token and store new access token to your data store.
}
```

For further usage of this package please refer to the [core package documentation on "Refreshing a Token"](https://github.com/thephpleague/oauth2-client#refreshing-a-token).

Testing
-------

[](#testing)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Knut Melvær](https://github.com/kmelve)
- [Steven Maguire](https://github.com/stevenmaguire)
- [All Contributors](https://github.com/stevenmaguire/oauth2-heroku/contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3213d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1131579?v=4)[Knut Melvær](/maintainers/kmelve)[@kmelve](https://github.com/kmelve)

---

Top Contributors

[![kmelve](https://avatars.githubusercontent.com/u/1131579?v=4)](https://github.com/kmelve "kmelve (7 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationtwist

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/netliferesearch-oauth2-twist/health.svg)

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

###  Alternatives

[stevenmaguire/oauth2-keycloak

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

2306.6M50](/packages/stevenmaguire-oauth2-keycloak)[thenetworg/oauth2-azure

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

25111.1M93](/packages/thenetworg-oauth2-azure)[patrickbussmann/oauth2-apple

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

1162.9M14](/packages/patrickbussmann-oauth2-apple)[omines/oauth2-gitlab

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

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

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

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

Mollie Provider for OAuth 2.0 Client

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

PHPackages © 2026

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