PHPackages                             edwin-luijten/oauth2-runkeeper - 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. edwin-luijten/oauth2-runkeeper

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

edwin-luijten/oauth2-runkeeper
==============================

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

1.1.0(9y ago)49.1kMITPHPPHP &gt;=5.5.0

Since Feb 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Edwin-Luijten/oauth2-runkeeper)[ Packagist](https://packagist.org/packages/edwin-luijten/oauth2-runkeeper)[ RSS](/packages/edwin-luijten-oauth2-runkeeper/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Runkeeper Provider for OAuth 2.0 Client
=======================================

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

[![Latest Version](https://camo.githubusercontent.com/9c73db9d02d8d031dc85faeeeab2c2cf682a885479dd6cbff6b988a9e58ff427/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f656477696e2d6c75696a74656e2f6f61757468322d72756e6b65657065722e7376673f7374796c653d666c6174)](https://github.com/Edwin-Luijten/oauth2-runkeeper/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/5c4cdf3ceaeb1a05694cd1ca3ca1b3ab821fcfae85c08fa4c817532ffb1fea55/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f456477696e2d4c75696a74656e2f6f61757468322d72756e6b65657065722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Edwin-Luijten/oauth2-runkeeper)[![Code Coverage](https://camo.githubusercontent.com/9208018fbf879d720f450d4156f9ac287e3e475a9c0d519b779612be9bdf0b83/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f456477696e2d4c75696a74656e2f6f61757468322d72756e6b65657065722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Edwin-Luijten/oauth2-runkeeper/?branch=master)[![Quality Score](https://camo.githubusercontent.com/edb86e03dd332cedb05580411c2eba54c58eeb401b4b83026a3ef5865f2b833b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f456477696e2d4c75696a74656e2f6f61757468322d72756e6b65657065722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Edwin-Luijten/oauth2-runkeeper/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9e9f958e687dbc921970c89053c666793249d8a33f8ce511d656cde0a64c7384/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656477696e2d6c75696a74656e2f6f61757468322d72756e6b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/edwin-luijten/oauth2-runkeeper)

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

Install
-------

[](#install)

Via Composer

```
$ composer require edwin-luijten/oauth2-runkeeper
```

Usage
-----

[](#usage)

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

```
$provider = new League\OAuth2\Client\Provider\Runkeeper([
    'clientId'          => '{runkeeper-client-id}',
    'clientSecret'      => '{runkeeper-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->getFirstName() . ' ' . $user->getLastName());

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

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email :author\_email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Edwin Luijten](https://github.com/Edwin-Luijten)
- [All Contributors](https://github.com/Edwin-Luijten/oauth2-runkeeper/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~175 days

Total

3

Last Release

3446d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e6993df069a061031d80e7fbbf3d4e51b7d84563b08224b10cad084c1308e8a?d=identicon)[Edwin-Luijten](/maintainers/Edwin-Luijten)

---

Top Contributors

[![Edwin-Luijten](https://avatars.githubusercontent.com/u/1339637?v=4)](https://github.com/Edwin-Luijten "Edwin-Luijten (3 commits)")[![it-can](https://avatars.githubusercontent.com/u/644288?v=4)](https://github.com/it-can "it-can (2 commits)")

---

Tags

clientAuthenticationoauthoauth2authorizationrunkeeper

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/edwin-luijten-oauth2-runkeeper/health.svg)

```
[![Health](https://phpackages.com/badges/edwin-luijten-oauth2-runkeeper/health.svg)](https://phpackages.com/packages/edwin-luijten-oauth2-runkeeper)
```

###  Alternatives

[league/oauth2-google

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

42223.4M176](/packages/league-oauth2-google)[thenetworg/oauth2-azure

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

25310.7M83](/packages/thenetworg-oauth2-azure)[cakedc/oauth2-cognito

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

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

PHPackages © 2026

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