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

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

worksection/oauth2-wrike
========================

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

1.1.0(3y ago)03.2k↓43.5%MITPHPPHP &gt;=7.2

Since May 31Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (4)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 worksection/oauth2-wrike

```

Usage
-----

[](#usage)

```
$wrikeProvider = new \Worksection\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).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

2

Last Release

1448d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.3

1.1.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0305c909e718f5addcfac4947fa258274c167f4baf16cab960a141a24d95f7f8?d=identicon)[Worksection](/maintainers/Worksection)

---

Top Contributors

[![vadymskk](https://avatars.githubusercontent.com/u/68269374?v=4)](https://github.com/vadymskk "vadymskk (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[league/oauth2-google

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

42121.2M118](/packages/league-oauth2-google)[knpuniversity/oauth2-client-bundle

Integration with league/oauth2-client to provide services

84016.7M61](/packages/knpuniversity-oauth2-client-bundle)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[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)[microsoft/kiota-authentication-phpleague

Authentication provider for Kiota using the PHP League OAuth 2.0 client to authenticate against the Microsoft Identity platform

153.2M7](/packages/microsoft-kiota-authentication-phpleague)

PHPackages © 2026

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