PHPackages                             edwin-luijten/oauth2-moves - 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. edwin-luijten/oauth2-moves

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

edwin-luijten/oauth2-moves
==========================

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

1.0.1(9y ago)019[1 PRs](https://github.com/Edwin-Luijten/oauth2-moves/pulls)MITPHPPHP &gt;=5.5.0

Since Feb 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Edwin-Luijten/oauth2-moves)[ Packagist](https://packagist.org/packages/edwin-luijten/oauth2-moves)[ RSS](/packages/edwin-luijten-oauth2-moves/feed)WikiDiscussions master Synced 4w ago

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

Moves Provider for OAuth 2.0 Client
===================================

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

[![Latest Version](https://camo.githubusercontent.com/1917d14b1035cc1b29f369252d569107778397eeb440a1cb7ca6e18b11c46a1a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f656477696e2d6c75696a74656e2f6f61757468322d6d6f7665732e7376673f7374796c653d666c6174)](https://github.com/Edwin-Luijten/oauth2-moves/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/04d92a7a4e6e69dfcae90536d30400a54b4e35fb138fc47aa62c89c214284846/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f456477696e2d4c75696a74656e2f6f61757468322d6d6f7665732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Edwin-Luijten/oauth2-moves)[![Code Coverage](https://camo.githubusercontent.com/3bdfcbfd31a40709d4b5ed38556b4ad2380cb24073969ad0e784cc764cd2dfe6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f456477696e2d4c75696a74656e2f6f61757468322d6d6f7665732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Edwin-Luijten/oauth2-moves/?branch=master)[![Quality Score](https://camo.githubusercontent.com/9bdce0381352c828f8f9a20d6e48e601c53de85dc259da440113b4ba715ab57b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f456477696e2d4c75696a74656e2f6f61757468322d6d6f7665732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Edwin-Luijten/oauth2-moves/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/082f5dd8de13eeb71a8e42d2d84cedf7dd7e18ea5fc4d3ea084195fbe39c840c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656477696e2d6c75696a74656e2f6f61757468322d6d6f7665732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/edwin-luijten/oauth2-moves)

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

Install
-------

[](#install)

Via Composer

```
$ composer require edwin-luijten/oauth2-moves
```

Usage
-----

[](#usage)

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

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

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email :author\_email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Edwin Luijten](https://github.com/Edwin-Luijten)
- [All Contributors](https://github.com/Edwin-Luijten/oauth2-moves/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~170 days

Total

2

Last Release

3623d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e6993df069a061031d80e7fbbf3d4e51b7d84563b08224b10cad084c1308e8a?d=identicon)[Edwin-Luijten](/maintainers/Edwin-Luijten)

---

Top Contributors

[![Edwin-Luijten](https://avatars.githubusercontent.com/u/1339637?v=4)](https://github.com/Edwin-Luijten "Edwin-Luijten (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

clientAuthenticationoauthoauth2authorizationmoves

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/edwin-luijten-oauth2-moves/health.svg)

```
[![Health](https://phpackages.com/badges/edwin-luijten-oauth2-moves/health.svg)](https://phpackages.com/packages/edwin-luijten-oauth2-moves)
```

###  Alternatives

[league/oauth2-google

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

42222.6M157](/packages/league-oauth2-google)[cakedc/oauth2-cognito

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

18615.2k](/packages/cakedc-oauth2-cognito)

PHPackages © 2026

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