PHPackages                             antalaron/oauth2-disqus - 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. antalaron/oauth2-disqus

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

antalaron/oauth2-disqus
=======================

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

v1.0.2(2y ago)0978MITPHPPHP ^7.4 || ^8.0

Since May 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/antalaron/oauth2-disqus)[ Packagist](https://packagist.org/packages/antalaron/oauth2-disqus)[ RSS](/packages/antalaron-oauth2-disqus/feed)WikiDiscussions master Synced 1mo ago

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

Disqus Provider for OAuth 2.0 Client
====================================

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

[![CI](https://github.com/antalaron/oauth2-disqus/actions/workflows/ci.yaml/badge.svg)](https://github.com/antalaron/oauth2-disqus/actions/workflows/ci.yaml)[![codecov](https://camo.githubusercontent.com/20c535694fd3b82d8e92400a9db7b2d11ae6b88d23874dea87fe7a2a3d12ad8a/68747470733a2f2f636f6465636f762e696f2f67682f616e74616c61726f6e2f6f61757468322d6469737175732f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d54534c4133484f334759)](https://codecov.io/gh/antalaron/oauth2-disqus)

This package provides [Disqus](https://disqus.com) 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 antalaron/oauth2-disqus

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\Antalaron\DisqusOAuth2\Disqus` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Antalaron\DisqusOAuth2\Disqus([
    'clientId' => '{disqus-public-key}',
    'clientSecret' => '{disqus-secret-key}',
    '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
```

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~24 days

Total

3

Last Release

1056d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/464e80a7b766518129809bfb8ac8b22e8c51d274d66f2423d66520772413134c?d=identicon)[antalaron](/maintainers/antalaron)

---

Top Contributors

[![antalaron](https://avatars.githubusercontent.com/u/9386504?v=4)](https://github.com/antalaron "antalaron (12 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationdisqus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/antalaron-oauth2-disqus/health.svg)

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

###  Alternatives

[stevenmaguire/oauth2-keycloak

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

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

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

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

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

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

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