PHPackages                             dindigital/social-auth - 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. dindigital/social-auth

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

dindigital/social-auth
======================

0172PHP

Since Dec 24Pushed 11y agoCompare

[ Source](https://github.com/mariosmello/SocialAuth)[ Packagist](https://packagist.org/packages/dindigital/social-auth)[ RSS](/packages/dindigital-social-auth/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

API authentication to social networks
=====================================

[](#api-authentication-to-social-networks)

Install
-------

[](#install)

Using composer:

```
{
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "dindigital/social_auth": "dev-master"
  }
}
```

Google
======

[](#google)

Auth Example
------------

[](#auth-example)

```
require 'vendor/autoload.php';

use Din\SocialAuth\Google\Auth;
use Din\SocialAuth\Google\Scope;
use Din\SocialAuth\Google\Exception\Auth_Exception;

/**
 * Configurações
 */
$id = '';
$secret = '';
$devkey = '';
$token = null;
$redirect_url = '';

/**
 * Modelo Implementação
 */
$googleAuth = new Auth;
$googleAuth->setClientId($id);
$googleAuth->setClientSecret($secret);
$googleAuth->setDeveloperKey($devkey);
$googleAuth->setRedirectUri($redirect_url);

// Define qual permissão o Google fornecerá
$scope = new Scope;
$scope->setYouTube();
$scope->setAnalytcs();

$googleAuth->setScope($scope);

try {

	if (isset($_GET['code'])) {
		$googleAuth->authCode($_GET['code']);
		// Persistir o token: $googleAuth->getToken()
		header("Location: {$redirect_url}");
	}

	$googleAuth->setToken($token);

} catch (Exception $e) {
	$url = $googleAuth->getAuthUrl();
	echo ''.$e->getMessage().'';
	echo 'Login';
	exit;
}

if ($googleAuth->hasUpdated()) {
	// Persistir o token: $googleAuth->getToken()
}
```

YouTube
-------

[](#youtube)

### Insert Video

[](#insert-video)

```
$youtube = new Din\SocialAuth\Google\Services\YouTube($googleAuth);
$youtube->setTitle('Teste YouTube');
$youtube->setDescription('Teste da descrução');
$youtube->setTags(array('tag1', 'tag2'));
$youtube->setPrivacy('private');

$file = $_SERVER['DOCUMENT_ROOT'] . '/test.mp4';

$id_youtube = $youtube->insert($file);
echo $id_youtube;
```

### Delete Video

[](#delete-video)

Analytics
---------

[](#analytics)

### URL search views by date range

[](#url-search-views-by-date-range)

```
$ga = new Din\SocialAuth\Google\Services\Analytics($googleAuth);
$ga->setProperty('XXXXXXX');
$ga->setStartDate('2014-12-01');
$ga->setEndDate(date('Y-m-d'));
$ga->setUri('/xxxxx/xxxxxxxxx/');
echo $ga->getVisits();
```

Facebook
========

[](#facebook)

Twitter
=======

[](#twitter)

Instagram
=========

[](#instagram)

ISSUU
=====

[](#issuu)

Linkedin
========

[](#linkedin)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1241449?v=4)[Mário Mello](/maintainers/mariosmello)[@mariosmello](https://github.com/mariosmello)

---

Top Contributors

[![mariosmello](https://avatars.githubusercontent.com/u/1241449?v=4)](https://github.com/mariosmello "mariosmello (2 commits)")

### Embed Badge

![Health badge](/badges/dindigital-social-auth/health.svg)

```
[![Health](https://phpackages.com/badges/dindigital-social-auth/health.svg)](https://phpackages.com/packages/dindigital-social-auth)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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