PHPackages                             devdot/churchtools-oauth2-client - 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. devdot/churchtools-oauth2-client

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

devdot/churchtools-oauth2-client
================================

OAuth2 Client for ChurchTools

v1.0.0(1y ago)232MITPHPPHP ^8.0

Since Jan 2Pushed 1y ago1 watchersCompare

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

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

devdot/churchtools-oauth2-client
================================

[](#devdotchurchtools-oauth2-client)

*OAuth2 Client for ChurchTools*

Installation
============

[](#installation)

```
composer require devdot/churchtools-oauth2-client

```

Basic Usage
===========

[](#basic-usage)

```
use Devdot\ChurchTools\OAuth2\Client\Provider\ChurchTools;

$provider = new ChurchTools([
    'url' => 'https://YOUR-INSTANCE.church.tools',
    'clientId' => 'Client-ID-From-OAUTH2-Setup',
    'redirectUri' => 'The Redirect Uri you provided to CT',
]);

$code = $_GET['code'] ?? null;

if ($code === null) {
    // redirect to OAuth Server
    $redirect = $provider->getAuthorizationUrl();

    header('Location: ' . $redirect);
    exit;
}
else {
    try {
        // attempt to get access tokens
        $tokens = $provider->getAccessTokenFromCode($code);

        // get the user that was authenticated
        $oauthUser = $provider->getResourceOwner($tokens);

        // store to session or use for further validation
        // ...
    }
    catch (League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
        if ($e->getMessage() === 'invalid_grant') {
            // code is not valid anymore, try again
            header('Location: ' . $provider->getAuthorizationUrl());
            exit;
        }

        throw $e;
    }
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance40

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

501d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f163f5df7377ef004e7cdaf08b905936b0af3d85b680d986dce83fd1bd0a0ad?d=identicon)[thomaskuschan](/maintainers/thomaskuschan)

---

Top Contributors

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

---

Tags

clientAuthenticationoauthoauth2authorizationchurchtools

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/devdot-churchtools-oauth2-client/health.svg)

```
[![Health](https://phpackages.com/badges/devdot-churchtools-oauth2-client/health.svg)](https://phpackages.com/packages/devdot-churchtools-oauth2-client)
```

###  Alternatives

[league/oauth2-google

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

42121.2M118](/packages/league-oauth2-google)[cakedc/oauth2-cognito

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

18597.7k](/packages/cakedc-oauth2-cognito)

PHPackages © 2026

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