PHPackages                             austomos/oauth2-chaster-app - 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. austomos/oauth2-chaster-app

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

austomos/oauth2-chaster-app
===========================

Chaster App OAuth 2.0 Client Provider for The PHP League OAuth2-Client

v0.1.1(3y ago)219MITPHPPHP &gt;=7.4

Since May 16Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Austomos/oauth2-chaster-app)[ Packagist](https://packagist.org/packages/austomos/oauth2-chaster-app)[ RSS](/packages/austomos-oauth2-chaster-app/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Chaster App Provider for OAuth 2.0 Client
=========================================

[](#chaster-app-provider-for-oauth-20-client)

[![Latest Version](https://camo.githubusercontent.com/0ad76249145df15034bf4ad1c6beb228f1ee59226ec09f6725d1d963c1703db5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f617573746f6d6f732f6f61757468322d636861737465722d6170702e737667)](https://github.com/austomos/oauth2-chaster-app/releases)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![PR Validation](https://camo.githubusercontent.com/40160cb789782533e19eec465171b50f7abefb253ef763ef573fbdeeaa954d35/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617573746f6d6f732f6f61757468322d636861737465722d6170702f43493f6c6162656c3d505225323056616c69646174696f6e266c6f676f3d676974687562)](https://github.com/austomos/oauth2-chaster-app/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/0e062c1dcec3100621068b4074f1b2747fc5ea7769d5bb23115ad39addb505fc/68747470733a2f2f636f6465636f762e696f2f67682f417573746f6d6f732f6f61757468322d636861737465722d6170702f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d344b3144505a4c573742)](https://codecov.io/gh/Austomos/oauth2-chaster-app)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c95f272fc6e82ae7a88168a935cb2e80c34bfd27ca3585690f5083abfb0b6939/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f417573746f6d6f732f6f61757468322d636861737465722d6170702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Austomos/oauth2-chaster-app/?branch=main)[![Build Status](https://camo.githubusercontent.com/ada3fa7ddae91d4c082c134054f25eb87df293932abf57bcf564747ce318b668/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f417573746f6d6f732f6f61757468322d636861737465722d6170702f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Austomos/oauth2-chaster-app/build-status/main)

This package provides [Chaster App](https://chaster.app) OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).
For more information on Chaster App API, please refer to its [documentation](https://docs.chaster.app/api-oauth-2/).

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

[](#installation)

To install, use composer:

```
composer require austomos/oauth2-chaster-app

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Austomos\OAuth2\Client\Provider\ChasterApp([
    'clientId'          => '{chaster-client-id}',
    'clientSecret'      => '{chaster-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->getUsername());

    } 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();
}
```

### Managing Scopes

[](#managing-scopes)

When creating your Chaster authorization URL, you can specify scopes your application may authorize.

```
$options = [
    'scope' => ['profile', 'locks', '...'] // array or string
];

$authorizationUrl = $provider->getAuthorizationUrl($options);
```

If neither are defined, the provider will utilize internal defaults.

At the time of authoring this documentation, the [following scopes are available](https://docs.chaster.app/api-scopes).

ScopeDescription`profile`Access the username and email`locks`View and edit locks`shared_locks`View and manage shared locks`keyholder`View and manage locked users`messaging`View and send private messagesTesting
-------

[](#testing)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/austomos/oauth2-chaster-app/blob/main/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Ben Hyr](https://github.com/austomos)
- [All Contributors](https://github.com/austomos/oauth2-chaster-app/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/austomos/oauth2-chaster-app/blob/main/LICENSE) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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

Total

2

Last Release

1384d ago

PHP version history (2 changes)v0.1.0PHP ^8.0 || ^8.1

v0.1.1PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/03d963671d621cac40d0ca57c23b0c33207d3d5412510865addf432b265bc6ae?d=identicon)[Austomos](/maintainers/Austomos)

---

Top Contributors

[![Austomos](https://avatars.githubusercontent.com/u/52321971?v=4)](https://github.com/Austomos "Austomos (45 commits)")

---

Tags

chaster-appoauth2oauth2-clientclientoauthoauth2authorizationauthorisationchaster.appchaster

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/austomos-oauth2-chaster-app/health.svg)

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

###  Alternatives

[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)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

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

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

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