PHPackages                             aporat/oauth2-tumblr - 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. aporat/oauth2-tumblr

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

aporat/oauth2-tumblr
====================

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

1.0.0(6mo ago)0246↑25%[1 PRs](https://github.com/aporat/oauth2-tumblr/pulls)MITPHPPHP ^8.1CI passing

Since Oct 29Pushed 5mo agoCompare

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

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

Tumblr Provider for OAuth 2.0 Client
====================================

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

\[![Latest Stable Version]()\[[![Software License]()](LICENSE)\[![codecov]()![GitHub Actions Workflow Status]()\[![Total Downloads]()

This package provides **Tumblr** OAuth 2.0 support for the PHP League's OAuth 2.0 Client.

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

[](#installation)

Install via Composer:

```
composer require aporat/oauth2-tumblr
```

*(Note: This will only work after you have published the package to Packagist. See my previous message about testing locally.)*

Usage
-----

[](#usage)

Usage follows The League's OAuth 2.0 client style, using `\Aporat\OAuth2\Client\Provider\Tumblr` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Aporat\OAuth2\Client\Provider\Tumblr([
'clientId'     => '{tumblr-client-id}',
'clientSecret' => '{tumblr-client-secret}',
'redirectUri'  => 'httpss://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();
$_SESSION['oauth2pkceCode'] = $provider->getPkceCode();

    header('Location: ' . $authUrl);
    exit;
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
// Check given state against previously stored one to mitigate CSRF attack
unset($_SESSION['oauth2state']);
exit('Invalid state');
} else {
$provider->setPkceCode($_SESSION['oauth2pkceCode']);

    // 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 user's 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->getUsername());
    } catch (Exception $e) {
        // Failed to get user details
        exit('Oh dear...');
    }

    // Use this to interact with an API on the user's behalf
    echo $token->getToken();
}
```

### Managing Scopes

[](#managing-scopes)

When creating your Tumblr authorization URL, you can specify the state and scopes your application may authorize.

```
$options = [
'state' => 'OPTIONAL_CUSTOM_CONFIGURED_STATE',
'scope' => ['basic', 'write', 'offline_access'] // Adjust scopes as needed
];

$authorizationUrl = $provider->getAuthorizationUrl($options);
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see the License File for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance70

Regular maintenance activity

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

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

201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/54592564aa6e76cb00fdb16a8b7fadaea333de11da7fd8a739fe4812237a551c?d=identicon)[aporat](/maintainers/aporat)

---

Top Contributors

[![aporat](https://avatars.githubusercontent.com/u/415576?v=4)](https://github.com/aporat "aporat (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationtumblr

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/aporat-oauth2-tumblr/health.svg)

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

###  Alternatives

[stevenmaguire/oauth2-keycloak

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

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

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

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

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