PHPackages                             runalyze/oauth2-polar-open-accesslink - 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/oauth2-polar-open-accesslink

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

runalyze/oauth2-polar-open-accesslink
=====================================

Polar Open Accesslink OAuth 2.0 Client Provider for The PHP League OAuth2-Client

v1.0.0(5y ago)37.8k↑16.7%1[1 issues](https://github.com/Runalyze/oauth2-polar-open-accesslink/issues)MITPHPPHP &gt;=5.6.0CI failing

Since Jul 2Pushed 5y ago3 watchersCompare

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

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

Polar Open Accesslink for OAuth 2.0 Client
==========================================

[](#polar-open-accesslink-for-oauth-20-client)

[![Latest Version](https://camo.githubusercontent.com/df45e00fcfd37060c3d65a1358b92a05e478f0e51c498be7b1164240c88962bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f72756e616c797a652f6f61757468322d706f6c61722d6f70656e2d6163636573736c696e6b2e7376673f7374796c653d666c6174)](https://github.com/runalyze/oauth2-polar-open-accesslink/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/fbadf15495cf7d3cfddb645c6b3a380870e2a7460beba64a9bd5f8b7eecd8fce/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72756e616c797a652f6f61757468322d706f6c61722d6f70656e2d6163636573736c696e6b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/runalyze/oauth2-polar-open-accesslink)[![Code Coverage](https://camo.githubusercontent.com/04605f13e27a20e45862c509c34609bfee29536edd9d511a5781e9250d7755c7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f72756e616c797a652f6f61757468322d706f6c61722d6f70656e2d6163636573736c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/runalyze/oauth2-polar-open-accesslink/?branch=master)[![Quality Score](https://camo.githubusercontent.com/6652a460a3e47e9941cc149bcf097bb04b3cbe8af6d8c9cf1cc4ea27f326db47/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72756e616c797a652f6f61757468322d706f6c61722d6f70656e2d6163636573736c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/runalyze/oauth2-polar-open-accesslink/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/911628585ac67d2cb4baf1f104c6f8cf734de56555251d38ac297ceab729523b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72756e616c797a652f6f61757468322d706f6c61722d6f70656e2d6163636573736c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/runalyze/oauth2-polar-open-accesslink)

```
This package provides Polar Open Accesslink 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 runalyze/oauth2-polar-open-accesslink dev-master
```

Usage
-----

[](#usage)

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

```
$provider = new League\OAuth2\Client\Provider\PolarOpenAccesslink([
    'clientId'     => '{polar-open-accesslink-id}',
    'clientSecret' => '{polar-open-accesslink-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();
}
```

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)

- [Michael Pohl](https://github.com/mipapo)
- [All Contributors](https://github.com/runalyze/oauth2-polar-open-accesslink/graphs/contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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

2140d ago

### 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 (13 commits)")[![laufhannes](https://avatars.githubusercontent.com/u/8313118?v=4)](https://github.com/laufhannes "laufhannes (1 commits)")

---

Tags

clientAuthenticationoauthoauth2authorizationpolarOpenAccessLinkpolarFlow

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/runalyze-oauth2-polar-open-accesslink/health.svg)

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

###  Alternatives

[league/oauth2-google

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

41721.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)
