PHPackages                             itlessons/php-social - 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. itlessons/php-social

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

itlessons/php-social
====================

PHP Social Auth Library

0.0.1(11y ago)4758[1 PRs](https://github.com/itlessons/php-social/pulls)MITPHPPHP &gt;=5.3.3

Since Jun 30Pushed 7y ago2 watchersCompare

[ Source](https://github.com/itlessons/php-social)[ Packagist](https://packagist.org/packages/itlessons/php-social)[ Docs](https://github.com/itlessons/php-social)[ RSS](/packages/itlessons-php-social/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

php-social
==========

[](#php-social)

The library to make work with social networks easy. They can auth with OAuth 2.0 or OAuth 1+ protocols and retrieve user profile info. Support Vkontakte, Facebook, Twitter, Github, MailRu. Works with PHP 5.3.3 or later.

Usage
-----

[](#usage)

You can see [base example](https://github.com/itlessons/php-social/tree/master/examples/base).

Auth in vk.com:

```
// config.php
$APP_ID_VK = -1; // app id
$APP_SECRET_VK = 'some secret code';
$APP_SCOPE_VK = ''; //some permissions
$REDIRECT_URL_VK = 'http://domain.ltd/auth_callback_vk.php';

// auth_vk.php
require __DIR__.'/config.php';
$auth = new \Social\Auth\AuthVk($APP_ID_VK, $APP_SECRET_VK, $APP_SCOPE_VK);
$url = $auth->getAuthorizeUrl($REDIRECT_URL_VK);
stopAndRedirect($url);

```

Now create callback file and get first api call:

```
// auth_callback_vk.php
require __DIR__.'/config.php';
$auth = new \Social\Auth\AuthVk($APP_ID_VK, $APP_SECRET_VK, $APP_SCOPE_VK);
$token = $auth->authenticate($_REQUEST, $REDIRECT_URL_VK);

if($token == null){
    var_dump($auth->getError());
    //exit
}

//call api with access_token
$api = new \Social\Api\ApiVk($token);
$user = $api->getProfile();

//use user data

// $user->id
// $user->firstName
// $user->lastName
// $user->nickname
// $user->screenName
// $user->photoUrl
// $user->photoBigUrl
// ...

```

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

[](#installation)

The recommended way to install php-social is through [Composer](http://getcomposer.org). Just create a `composer.json` file and run the `php composer.phar install` command to install it:

```
{
    "require": {
        "itlessons/php-social": "*"
    }
}

```

Alternatively, you can download the [php-social.zip](https://github.com/itlessons/php-social/archive/master.zip) file and extract it.

Read
----

[](#read)

- \[Авторизация с помощью OAuth 2.0 в Вконтакте, Моем мире и Facebook\] ()
- \[Авторизация на вашем сайте с помощью Github\] ()
- \[Авторизация и работа с Twitter Api через OAuth\] ()

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

4336d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7283c22f1b152268a8a17acd947f00c4f65f41401a34407f2319de57cca45fb8?d=identicon)[itlessons](/maintainers/itlessons)

---

Top Contributors

[![itlessons](https://avatars.githubusercontent.com/u/5404185?v=4)](https://github.com/itlessons "itlessons (22 commits)")

---

Tags

apifacebookauthoauthgithubtwittersocialvkmailru

### Embed Badge

![Health badge](/badges/itlessons-php-social/health.svg)

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

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[hybridauth/hybridauth

PHP Social Authentication Library

3.4k8.5M94](/packages/hybridauth-hybridauth)[socialconnect/auth

Social Connect Auth Component

568845.4k5](/packages/socialconnect-auth)[lorenzoferrarajr/lfj-opauth

LfjOpauth is a Zend Framework 2 module that enables support for many authentication providers through the Opauth framework.

2915.4k](/packages/lorenzoferrarajr-lfj-opauth)

PHPackages © 2026

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