PHPackages                             chrishemmings/oauth2-deezer - 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. chrishemmings/oauth2-deezer

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

chrishemmings/oauth2-deezer
===========================

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

1.0.0(10y ago)2297MITPHPPHP &gt;=5.5.0

Since Feb 12Pushed 10y ago1 watchersCompare

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

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

Deezer Provider for OAuth 2.0 Client
====================================

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

[![Latest Version](https://camo.githubusercontent.com/20ae72684e03e4c58068aa67c44d2c263ed2b6f8010835f101901083c1d2edc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f636872697368656d6d696e67732f6f61757468322d6465657a65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/chrishemmings/oauth2-deezer/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/7a57a2d76e71f81fcb9ae1a7da4c17408037b379182368abdd0092020a96d96f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636872697368656d6d696e67732f6f61757468322d6465657a65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/chrishemmings/oauth2-deezer)[![Quality Score](https://camo.githubusercontent.com/01a62b64677ad433d461342e924cadde74272d088f79248a53030c46672123c6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636872697368656d6d696e67732f6f61757468322d6465657a65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/chrishemmings/oauth2-deezer)[![Total Downloads](https://camo.githubusercontent.com/a806afecb67cecb296eb19871fc70ee45d58a94277c7dcbb1ff5d0163d545810/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636872697368656d6d696e67732f6f61757468322d6465657a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chrishemmings/oauth2-deezer)

This package provides Deezer 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 chrishemmings/oauth2-deezer

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

```
require_once('./vendor/autoload.php');
session_start();

$provider = new \ChrisHemmings\OAuth2\Client\Provider\Deezer([
    'clientId'          => '{deezer-client-id}',
    'clientSecret'      => '{deezer-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->getName());

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

Credits
-------

[](#credits)

- [Chris Hemmings](https://github.com/chrishemmings)
- [All Contributors](https://github.com/chrishemmings/oauth2-deezer/contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3791d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8639948042c5affb0d40f2062b692b11ef04659c7d86d4a47ca9b0e7243e3bd6?d=identicon)[chrishemmings](/maintainers/chrishemmings)

---

Top Contributors

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

---

Tags

AuthenticationSSOidentityoauthoauth2authorizationidpsingle sign onDeezer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/chrishemmings-oauth2-deezer/health.svg)

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

###  Alternatives

[calcinai/oauth2-xero

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

103.3M4](/packages/calcinai-oauth2-xero)[adam-paterson/oauth2-slack

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

22728.9k9](/packages/adam-paterson-oauth2-slack)

PHPackages © 2026

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