PHPackages                             pbxg33k/oauth2-exact-provider - 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. pbxg33k/oauth2-exact-provider

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

pbxg33k/oauth2-exact-provider
=============================

Exact Online 2.0 Client Provider for The PHP Leage OAuth2-Client

1.0.0(11y ago)43.6k2MITPHP

Since Mar 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/PBXg33k/oauth2-exactonline)[ Packagist](https://packagist.org/packages/pbxg33k/oauth2-exact-provider)[ Docs](https://github.com/PBXg33k/oauth2-exactonline)[ RSS](/packages/pbxg33k-oauth2-exact-provider/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Exact Online Provider for OAuth 2.0 Client
==========================================

[](#exact-online-provider-for-oauth-20-client)

[![Build Status](https://camo.githubusercontent.com/f41708d1011ce392745f881f769d39043389f4d4c304c6affca8edd6540d81f1/68747470733a2f2f7472617669732d63692e6f72672f5042586733336b2f6f61757468322d65786163746f6e6c696e652e737667)](https://travis-ci.org/PBXg33k/oauth2-exactonline)

This package provides support for authenticating with Exact Online's OAuth2 provider using PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Demo
----

[](#demo)

Click [here](http://oauth2-exactonline.demos.oguzhanuysal.eu/ "OAuth2 for Exact Online demo") to see an online demonstration which allows you to authenticate using an Exact account.

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

[](#installation)

To install, use composer:

```
composer require pbxg33k/oauth2-exact-provider

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Pbxg33k\OAuth2\Client\Provider\Exactonline([
    'clientId'          => '{exact-client-id}',
    'clientSecret'      => '{exact-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->state;
    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
        $userDetails = $provider->getUserDetails($token);

        // Use these details to create a new profile
        printf('Hello %s!', $userDetails->firstName);

    } catch (Exception $e) {

        // Failed to get user details
        exit('Oh dear...');
    }

    // Use this to interact with an API on the users behalf
    echo $token->accessToken;
}
```

Refreshing a Token
------------------

[](#refreshing-a-token)

```
$provider = new Pbxg33k\OAuth2\Client\Provider\Exactonline([
    'clientId'          => '{zenpayroll-client-id}',
    'clientSecret'      => '{zenpayroll-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

$grant = new \League\OAuth2\Client\Grant\RefreshToken();
$token = $provider->getAccessToken($grant, ['refresh_token' => $refreshToken]);
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

4124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/056e16095aa1c6f1b8c0f914ca98d0d00fa7289d5c5c78d95face22210102ad5?d=identicon)[PBX\_g33k](/maintainers/PBX_g33k)

---

Top Contributors

[![PBXg33k](https://avatars.githubusercontent.com/u/1777196?v=4)](https://github.com/PBXg33k "PBXg33k (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pbxg33k-oauth2-exact-provider/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[thenetworg/oauth2-azure

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

25310.7M82](/packages/thenetworg-oauth2-azure)[league/oauth2-google

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

42223.4M176](/packages/league-oauth2-google)[stevenmaguire/oauth2-keycloak

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

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[patrickbussmann/oauth2-apple

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

1152.8M12](/packages/patrickbussmann-oauth2-apple)

PHPackages © 2026

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