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

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

dokeop/oauth2-dokeop
====================

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

1.0.2(5y ago)01MITPHPPHP ^5.6|^7.0CI failing

Since Jan 16Pushed 5y ago1 watchersCompare

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

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

Dokeop Provider for OAuth 2.0 Client
====================================

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

[![Latest Version](https://camo.githubusercontent.com/ec99154481ea648bef2f151204376b15ad4a8bc2f8fc392c87b2f74e8f726c42/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f646f6b656f702f6f61757468322d646f6b656f702e7376673f7374796c653d666c6174)](https://github.com/dokeop/oauth2-dokeop/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/985facd9b1998c4a414405e7fdaaffe5613de6204e57771828a7360ab34cddd3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f646f6b656f702f6f61757468322d646f6b656f702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/dokeop/oauth2-dokeop)[![Code Coverage](https://camo.githubusercontent.com/3a44cef862cd974e7145c5ec2ad2a95d89955578247241faca181cf7d92e84b8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f646f6b656f702f6f61757468322d646f6b656f702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dokeop/oauth2-dokeop/?branch=master)[![Quality Score](https://camo.githubusercontent.com/e4fcf5686b410f52b7e9ad04b76ac0dfc37ec29ab200223f724171f077448967/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f646f6b656f702f6f61757468322d646f6b656f702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dokeop/oauth2-dokeop/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/36c46831407f90abcada2a009f93a781ff12080d2e1d89bf27ce2bbc350592db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f6b656f702f6f61757468322d646f6b656f702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dokeop/oauth2-dokeop)

This package provides Dokeop 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 dokeop/oauth2-dokeop
```

Usage
-----

[](#usage)

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

```
$provider = new Dokeop\OAuth2\Client\Provider\Dokeop([
    'clientId'     => '{dokeop-client-id}',
    'clientSecret' => '{dokeop-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->getFirstName() . ' ' . $user->getLastName());

    } 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](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)

- [Dokeop](https://github.com/dokeop)
- [All Contributors](https://github.com/dokeop/oauth2-dokeop/graphs/contributors)

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~143 days

Total

3

Last Release

2020d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/97915284?v=4)[Dokeop](/maintainers/dokeop)[@dokeop](https://github.com/dokeop)

---

Top Contributors

[![vpiau](https://avatars.githubusercontent.com/u/59887190?v=4)](https://github.com/vpiau "vpiau (3 commits)")

---

Tags

clientAuthenticationoauthoauth2authorizationdokeop

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[cakedc/oauth2-cognito

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

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

PHPackages © 2026

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