PHPackages                             shadowhand/oauth2-untappd - 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. shadowhand/oauth2-untappd

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

shadowhand/oauth2-untappd
=========================

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

0.3.0(10y ago)153MITPHP

Since Mar 5Pushed 10y ago1 watchersCompare

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

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

Untappd Provider for OAuth 2.0 Client
=====================================

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

[![Build Status](https://camo.githubusercontent.com/552a54e68a83b417bfa0a29adf4aa7a9efb06e5a9bb8bb7cff59577b0b40ed87/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736861646f7768616e642f6f61757468322d756e74617070642e737667)](https://travis-ci.org/shadowhand/oauth2-untappd)[![Code Coverage](https://camo.githubusercontent.com/b12e16d6ce14e6e029811a457b26f30e2b8c639076a298f2e0e53d238935745c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736861646f7768616e642f6f61757468322d756e74617070642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/shadowhand/oauth2-untappd/?branch=master)[![Code Quality](https://camo.githubusercontent.com/0d0746c6ad2ec1e797bfd361facd8ff3a03d7f465ffeec0055e8ce346c1dbc70/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736861646f7768616e642f6f61757468322d756e74617070642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/shadowhand/oauth2-untappd/?branch=master)[![License](https://camo.githubusercontent.com/19d2a66419d4b1e2aa66cc65da3a341213b81d71a060d7053c8112ba06406a1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736861646f7768616e642f6f61757468322d756e74617070642e737667)](https://github.com/shadowhand/oauth2-untappd/blob/master/LICENSE)[![Latest Stable Version](https://camo.githubusercontent.com/3d0d86ac43442a47dec746f4403be1c848641aa9635441705547cf43e19e448a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736861646f7768616e642f6f61757468322d756e74617070642e737667)](https://packagist.org/packages/shadowhand/oauth2-untappd)

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

This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

Requirements
------------

[](#requirements)

The following versions of PHP are supported.

- PHP 5.5
- PHP 5.6
- PHP 7.0
- HHVM

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

[](#installation)

To install, use composer:

```
composer require shadowhand/oauth2-untappd

```

Usage
-----

[](#usage)

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Shadowhand\OAuth2\Client\Provider\Untappd([
    'clientId'     => '{untappd-app-id}',
    'clientSecret' => '{untappd-app-secret}',
    'redirectUri'  => 'https://example.com/callback-url',
    'hostedDomain' => 'example.com',
]);

if (!empty($_GET['error'])) {

    // Got an error, probably user denied access
    exit('Got error: ' . $_GET['error']);

} elseif (empty($_GET['code'])) {

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    header('Location: ' . $authUrl);
    exit;

} 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 owner details
        $ownerDetails = $provider->getResourceOwner($token);

        // Use these details to create a new profile
        printf('Hello %s!', $ownerDetails->getFirstName());

    } catch (Exception $e) {

        // Failed to get user details
        exit('Something went wrong: ' . $e->getMessage());

    }

    // Use this to interact with an API on the users behalf
    echo $token->accessToken;
}
```

**NOTE:** Untappd does not support `state` passing for verification.

### Refreshing a Token

[](#refreshing-a-token)

Untappd tokens do not expire and do not need to be refreshed.

Testing
-------

[](#testing)

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

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/thephpleague/oauth2-untappd/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Woody Gilk](https://github.com/shadowhand)
- [All Contributors](https://github.com/thephpleague/oauth2-untappd/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/thephpleague/oauth2-untappd/blob/master/LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~1 days

Total

5

Last Release

3714d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38203?v=4)[Woody Gilk](/maintainers/shadowhand)[@shadowhand](https://github.com/shadowhand)

---

Top Contributors

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

---

Tags

clientAuthenticationoauthoauth2authorizationuntappduntapped

### Embed Badge

![Health badge](/badges/shadowhand-oauth2-untappd/health.svg)

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

###  Alternatives

[league/oauth2-google

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

41721.2M117](/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)
