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

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

michaelkaefer/oauth2-wrike
==========================

Wrike OAuth 2.0 support for the PHP League's OAuth 2.0 Client

2.0.2(4y ago)01.2k2MITPHPPHP ^7.3 || ^8.0

Since Jul 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/michaelKaefer/oauth2-wrike)[ Packagist](https://packagist.org/packages/michaelkaefer/oauth2-wrike)[ RSS](/packages/michaelkaefer-oauth2-wrike/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (9)Used By (0)

Wrike Provider for OAuth 2.0 Client
===================================

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

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

> ***NOTE:*** since 2.x only Wrike's v4 API is supported (prior versions support Wrike's v3 API)

Installation
------------

[](#installation)

```
composer require michaelkaefer/oauth2-wrike

```

Usage
-----

[](#usage)

```
$wrikeProvider = new \MichaelKaefer\OAuth2\Client\Provider\Wrike([
    'clientId'                => 'yourId',    // The client ID assigned to you by Wrike
    'clientSecret'            => 'yourSecret',   // The client password assigned to you by the provider
    'redirectUri'             => ''
]);

// Get authorization code
if (!isset($_GET['code'])) {
    // Get authorization URL
    $authorizationUrl = $wrikeProvider->getAuthorizationUrl();

    // Get state and store it to the session
    $_SESSION['oauth2state'] = $wrikeProvider->getState();

    // Redirect user to authorization URL
    header('Location: ' . $authorizationUrl);
    exit;
// Check for errors
} elseif (empty($_GET['state']) || (isset($_SESSION['oauth2state']) && $_GET['state'] !== $_SESSION['oauth2state'])) {
    if (isset($_SESSION['oauth2state'])) {
        unset($_SESSION['oauth2state']);
    }
    exit('Invalid state');
} else {
    // Get access token
    try {
        $accessToken = $wrikeProvider->getAccessToken(
            'authorization_code',
            [
                'code' => $_GET['code']
            ]
        );
    } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
        exit($e->getMessage());
    }

    // Get resource owner
    try {
        $resourceOwner = $wrikeProvider->getResourceOwner($accessToken);
    } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
        exit($e->getMessage());
    }

    // Now you can store the results to session ...
    $_SESSION['accessToken'] = $accessToken;
    $_SESSION['resourceOwner'] = $resourceOwner;

    // ... or do some API request
    $folderId = 'yourFolderId';
    $request = $wrikeProvider->getAuthenticatedRequest(
        'GET',
        'https://www.wrike.com/api/v3/folders/' . $folderId . '/folders',
        $accessToken
    );
    try {
        $response = $wrikeProvider->getParsedResponse($request);
    } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
        exit($e->getMessage());
    }
    var_dump($response['data']);
}
```

For more information see the PHP League's general usage examples.

Testing
-------

[](#testing)

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

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% 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 ~246 days

Recently: every ~292 days

Total

8

Last Release

1490d ago

Major Versions

v1.0.4 → v2.0.12019-04-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/f49f39c9c35d3eb3d2a5f647da95c26e0f11e871f5e54b29c08e6608d8087a2a?d=identicon)[michaelKaefer](/maintainers/michaelKaefer)

---

Top Contributors

[![michaelKaefer](https://avatars.githubusercontent.com/u/13886409?v=4)](https://github.com/michaelKaefer "michaelKaefer (21 commits)")[![hernest](https://avatars.githubusercontent.com/u/13033528?v=4)](https://github.com/hernest "hernest (1 commits)")[![ursoforte](https://avatars.githubusercontent.com/u/578063?v=4)](https://github.com/ursoforte "ursoforte (1 commits)")

---

Tags

phpapiclientAuthenticationoauthoauth2authorizationwrike

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[league/oauth2-google

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

41721.2M117](/packages/league-oauth2-google)[league/oauth2-facebook

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

32013.0M65](/packages/league-oauth2-facebook)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

194.1k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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