PHPackages                             runalyze/php-oauth2-runalyze - 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. runalyze/php-oauth2-runalyze

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

runalyze/php-oauth2-runalyze
============================

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

11PHP

Since Mar 21Pushed 3y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Runalyze Provider for OAuth 2.0 Client
======================================

[](#runalyze-provider-for-oauth-20-client)

[![Latest Version](https://camo.githubusercontent.com/8476e772843287576524f41d8620dfb3c8649f1e02e0f800b90221343db8f453/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f72756e616c797a652f6f61757468322d72756e616c797a652e7376673f7374796c653d666c61742d737175617265)](https://github.com/runalyze/oauth2-runalyze/releases)[![Total Downloads](https://camo.githubusercontent.com/280983e74a86b5a1775b6c489ff08d77054d88eb798022cd9f0a7818d506d92d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72756e616c797a652f6f61757468322d72756e616c797a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/runalyze/oauth2-runalyze)

This package provides Runalyze OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

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

[](#installation)

To install the package, use composer:

```
composer require runalyze/oauth2-runalyze

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

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

// Send OAuth Request
// If we don't have an authorization code then we can get one
$authUrl = $provider->getAuthorizationUrl();
$_SESSION['OAuth2State'] = $provider->getState();

...

// OAuth2 Callback URL
// Compare given state against previously stored one to block CSRF attack
if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['OAuth2State'])) {

    exit('Invalid state');

} else {

    // Try to get an access token
    $token = $provider->getAccessToken('authorization_code', ['code' => $_GET['code']]);

    // Now we can look up users profile
    try {
        // Get the user's details
        $user = $provider->getResourceOwner($token);

        printf('Hello %s!', $user->getName());

    } catch (Exception $e) {
        // Failed to get user details
        exit('Oh no ... ...');
    }

    // We can use token to make other API calls
    echo $token->getToken();
}
```

Testing
-------

[](#testing)

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

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/50d6353d737e2c48fd129760b241891b35565b6e608878a12b5413896ccf929c?d=identicon)[mipapo](/maintainers/mipapo)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/runalyze-php-oauth2-runalyze/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

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