PHPackages                             tomas-kulhanek/oauth2-fakturoid - 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. tomas-kulhanek/oauth2-fakturoid

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

tomas-kulhanek/oauth2-fakturoid
===============================

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

v1.0.0(2mo ago)01MITPHPPHP &gt;=8.4CI passing

Since Feb 20Pushed 2mo agoCompare

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

READMEChangelogDependencies (9)Versions (2)Used By (0)

Fakturoid OAuth 2.0 Client Provider
===================================

[](#fakturoid-oauth-20-client-provider)

[![PHP Version](https://camo.githubusercontent.com/6e44ad49e5307c87d1393389feb52ab61c99956e2e5f8c77177b2501f1d3d47f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

[League OAuth2 Client](https://github.com/thephpleague/oauth2-client) provider for [Fakturoid](https://www.fakturoid.cz/) invoicing platform.

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

[](#installation)

```
composer require tomas-kulhanek/oauth2-fakturoid
```

Usage
-----

[](#usage)

### Authorization Code Flow

[](#authorization-code-flow)

```
use TomasKulhanek\OAuth2\Fakturoid\FakturoidProvider;

$provider = new FakturoidProvider([
    'clientId'     => 'your-client-id',
    'clientSecret' => 'your-client-secret',
    'redirectUri'  => 'https://your-app.com/callback',
]);

// Step 1: Redirect to authorization
$authUrl = $provider->getAuthorizationUrl();
$_SESSION['oauth2state'] = $provider->getState();
header('Location: ' . $authUrl);
exit;

// Step 2: Handle callback
if ($_GET['state'] !== $_SESSION['oauth2state']) {
    exit('Invalid state');
}

$token = $provider->getAccessToken('authorization_code', [
    'code' => $_GET['code'],
]);

// Step 3: Get resource owner
$owner = $provider->getResourceOwner($token);

echo $owner->getId();
echo $owner->getFullName();
echo $owner->getEmail();
echo $owner->getAvatarUrl();
echo $owner->getDefaultAccount();
```

### Client Credentials Flow

[](#client-credentials-flow)

```
$token = $provider->getAccessToken('client_credentials');
```

### Refreshing a Token

[](#refreshing-a-token)

```
$newToken = $provider->getAccessToken('refresh_token', [
    'refresh_token' => $existingToken->getRefreshToken(),
]);
```

### Accessing Accounts

[](#accessing-accounts)

The resource owner provides access to all Fakturoid accounts the user can manage:

```
$owner = $provider->getResourceOwner($token);

foreach ($owner->getAccounts() as $account) {
    echo $account['slug'];           // Account URL identifier
    echo $account['name'];           // Account name
    echo $account['permission'];     // 'owner', 'accountant', etc.
    echo $account['registration_no'];// Registration number
}
```

Fakturoid OAuth Endpoints
-------------------------

[](#fakturoid-oauth-endpoints)

EndpointURLAuthorization`https://app.fakturoid.cz/api/v3/oauth`Token`https://app.fakturoid.cz/api/v3/oauth/token`User Info`https://app.fakturoid.cz/api/v3/user.json`License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

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

Unknown

Total

1

Last Release

87d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7447745?v=4)[Tomáš Kulhánek](/maintainers/tomas-kulhanek)[@tomas-kulhanek](https://github.com/tomas-kulhanek)

---

Top Contributors

[![tomas-kulhanek](https://avatars.githubusercontent.com/u/7447745?v=4)](https://github.com/tomas-kulhanek "tomas-kulhanek (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tomas-kulhanek-oauth2-fakturoid/health.svg)

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

###  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)
