PHPackages                             wolftotem4/oauth2-dailymotion - 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. wolftotem4/oauth2-dailymotion

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

wolftotem4/oauth2-dailymotion
=============================

Dailymotion 2.0 Client Provider for The PHP League OAuth2-Client

v0.9.3(3y ago)03.2k1MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Nov 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wolftotem4/oauth2-dailymotion)[ Packagist](https://packagist.org/packages/wolftotem4/oauth2-dailymotion)[ RSS](/packages/wolftotem4-oauth2-dailymotion/feed)WikiDiscussions master Synced today

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

Dailymotion Provider for OAuth 2.0 Client
=========================================

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

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

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

[](#requirements)

The following versions of PHP are supported.

- PHP 5.6
- PHP 7.0
- PHP 7.1
- PHP 8.0
- PHP 8.1

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

[](#installation)

Add the following to your `composer.json` file.

```
{
    "require": {
        "wolftotem4/oauth2-dailymotion": "^0.9.1"
    }
}
```

Usage
-----

[](#usage)

### Authorization Code Flow

[](#authorization-code-flow)

```
session_start();

$provider = new \WTotem4\OAuth2\Client\Provider\Dailymotion([
    'clientId'          => '{dailymotion-app-key}',
    'clientSecret'      => '{dailymotion-app-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([
        'scope' => ['email', '...', '...'],
    ]);
    $_SESSION['oauth2state'] = $provider->getState();

    echo 'Log in with Dailymotion!';
    exit;

// Check given state against previously stored one to mitigate CSRF attack
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

    unset($_SESSION['oauth2state']);
    echo 'Invalid state.';
    exit;

}

// 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->getScreenname());

    echo '';
    var_dump($user);
    # object(WTotem4\OAuth2\Client\Provider\DailymotionUser)#10 (1) { ...
    echo '';

} catch (\Exception $e) {

    // Failed to get user details
    exit('Oh dear...');
}

echo '';
// Use this to interact with an API on the users behalf
var_dump($token->getToken());
# string(217) "EAABzGQwfmiMBAPxoLpTL...

// The time (in epoch time) when an access token will expire
var_dump($token->getExpires());
# int(1515911929)
echo '';
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~497 days

Total

5

Last Release

1165d ago

PHP version history (2 changes)v0.0.1PHP ^5.6 || ^7.0

v0.9.3PHP ^5.6 || ^7.0 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13431897?v=4)[Randolph Huang](/maintainers/wolftotem4)[@wolftotem4](https://github.com/wolftotem4)

---

Top Contributors

[![wolftotem4](https://avatars.githubusercontent.com/u/13431897?v=4)](https://github.com/wolftotem4 "wolftotem4 (14 commits)")[![mhugot](https://avatars.githubusercontent.com/u/3684974?v=4)](https://github.com/mhugot "mhugot (1 commits)")

---

Tags

clientAuthenticationoauthoauth2authorizationdailymotion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wolftotem4-oauth2-dailymotion/health.svg)

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

###  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)
