PHPackages                             runalyze/oauth2-suunto-api - 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-suunto-api

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

runalyze/oauth2-suunto-api
==========================

Suunto API OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1953↑50%4PHP

Since Aug 22Pushed 1y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

\[inProgress\] Suunto API
=========================

[](#inprogress-suunto-api)

[![Latest Version](https://camo.githubusercontent.com/eba1984cb449115fd3779d865fa83e957ed1aeefa455b2452938a5be2df4c973/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f72756e616c797a652f6f61757468322d7375756e746f2d6170692e7376673f7374796c653d666c6174)](https://github.com/runalyze/oauth2-suunto-api/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/05e2686793f40245e9941597aa7e660b1535f44575a0ab605917f9f7fc032d53/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72756e616c797a652f6f61757468322d7375756e746f2d6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/runalyze/oauth2-suunto-api)[![Code Coverage](https://camo.githubusercontent.com/ff7bb8f30ef5a5143ff717ecca9730d4ae5b88bbf42843a6bf94bb90aa51005c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f72756e616c797a652f6f61757468322d7375756e746f2d6170692e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/runalyze/oauth2-suunto-api/?branch=master)[![Quality Score](https://camo.githubusercontent.com/bd9386843421e7aeb07aae634ee6627d8075c791380c16898b25c8a0d777f20a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72756e616c797a652f6f61757468322d7375756e746f2d6170692e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/runalyze/oauth2-suunto-api/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/260940682495ea0a067ba67ad6706d89e0ebff7f7f3e4a998fd5aba7481ed6bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72756e616c797a652f6f61757468322d7375756e746f2d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/runalyze/oauth2-suunto-api)

```
This package provides Suunto API 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-suunto-api dev-master
```

Usage
-----

[](#usage)

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

```
$provider = new League\OAuth2\Client\Provider\Suunto([
    'clientId'     => '{suunto-api-id}',
    'clientSecret' => '{suunto-api-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-suunto-api/graphs/contributors)

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity17

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 (9 commits)")

### Embed Badge

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

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

###  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)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[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)

PHPackages © 2026

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