PHPackages                             imliam/oauth2-transferwise - 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. imliam/oauth2-transferwise

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

imliam/oauth2-transferwise
==========================

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

113PHP

Since Aug 31Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ImLiam/oauth2-transferwise)[ Packagist](https://packagist.org/packages/imliam/oauth2-transferwise)[ RSS](/packages/imliam-oauth2-transferwise/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

TransferWise Provider for OAuth 2.0 Client
==========================================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/6c7a45e4579dc68d4fe3795e2e43770bc980d187e5100ec3174d7cac7540806c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)](https://packagist.org/packages/imliam/oauth2-transferwise)[![Build Status](https://camo.githubusercontent.com/8838d9cb470be3e69bbdd46834405d76e97828e5ac045da80508cc8547218056/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)](https://travis-ci.org/imliam/oauth2-transferwise)[![Code Quality](https://camo.githubusercontent.com/df08b21b5dfcc719b89a4ccceb9bdf5998a83700db499e82da38f42a1893fe32/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)](https://camo.githubusercontent.com/df08b21b5dfcc719b89a4ccceb9bdf5998a83700db499e82da38f42a1893fe32/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)[![Code Coverage](https://camo.githubusercontent.com/d1102bbb289223dca5aa3f7d60441fe7d908e043b0da09c69f48ab8e825fc6af/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)](https://camo.githubusercontent.com/d1102bbb289223dca5aa3f7d60441fe7d908e043b0da09c69f48ab8e825fc6af/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)[![Total Downloads](https://camo.githubusercontent.com/5c0624ed650bcba3008a841ef5d17bf468ce3b4f4710418677e10b9ceaa670ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)](https://packagist.org/packages/imliam/oauth2-transferwise)[![License](https://camo.githubusercontent.com/42fcea8c9add04cc49ae46a5e38b04dc761700463e92195fa1230fb9de3c0d03/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696d6c69616d2f6f61757468322d7472616e73666572776973652e737667)](LICENSE.md)

This package provides TransferWise 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 imliam/oauth2-transferwise

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new ImLiam\OAuth2\Client\Provider\Transferwise([
    'clientId'          => '{transferwise-client-id}',
    'clientSecret'      => '{transferwise-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->getNickname());

    } 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/imliam/oauth2-transferwise/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Steven Maguire](https://github.com/stevenmaguire)
- [All Contributors](https://github.com/imliam/oauth2-transferwise/contributors)
- [Based off of league/oauth2-github](https://github.com/league/oauth2-github)

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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/3e8a14b9f997cf85aacea7d39da9dc33c38cc05fe03360578327ea9bcb25f4d9?d=identicon)[ImLiam](/maintainers/ImLiam)

---

Top Contributors

[![imliam](https://avatars.githubusercontent.com/u/4326337?v=4)](https://github.com/imliam "imliam (1 commits)")

### Embed Badge

![Health badge](/badges/imliam-oauth2-transferwise/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[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)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

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

PHPackages © 2026

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