PHPackages                             grippo/fb-php-server-login - 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. grippo/fb-php-server-login

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

grippo/fb-php-server-login
==========================

Facebook Login server to server

v2.0.0(5mo ago)145MITPHPPHP &gt;=5.5

Since Feb 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/grippo/fb-php-server-login)[ Packagist](https://packagist.org/packages/grippo/fb-php-server-login)[ RSS](/packages/grippo-fb-php-server-login/feed)WikiDiscussions master Synced today

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

Facebook Login for PHP (v2)
===========================

[](#facebook-login-for-php-v2)

This repository contains the open source PHP files that allows you to access the Facebook Platform from your PHP app, server to server, without Javascript.

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

[](#installation)

The Facebook Login PHP can be installed with [Composer](https://getcomposer.org/). Run this command:

```
composer require grippo/fb-php-server-login
```

Usage: INI File
---------------

[](#usage-ini-file)

Create a ".config.ini" file with facebook credentials and permissions. Permissions is an array, add how much as you need.

```
[facebook]
app_id={{ the app id }}
app_secret={{ the app secret }}
callback_url={{ the callback url }}
permissions[]=email
permissions[]={{ other permission }}
permissions[]={{ other permission }}
```

Usage: login
------------

[](#usage-login)

This code executes whenever the user clicks on the Login Button.

```
if(!session_id()) {
    session_start();
}

require_once __DIR__ . '/../vendor/autoload.php';

use \FbServer\Login;

// Is user logged in?
if (array_key_exists('facebook_access_token', $_SESSION) && isset($_SESSION['facebook_access_token']))
{
	// user is logged in
} else {
	$config = parse_ini_file('../.config.ini', true);
	$login = new Login(
		$config['facebook']['app_id'],
		$config['facebook']['app_secret'],
		$config['facebook']['callback_url'],
		$config['facebook']['permissions']
	);
	$url = $login->getLoginUrl();
	// redirect to $url to login
}
```

Usage: Callback
---------------

[](#usage-callback)

This code executes after the Facebook dialog returns to the callback url.

```
$config = parse_ini_file('../.config.ini', true);
$login = new Login(
	$config['facebook']['app_id'],
	$config['facebook']['app_secret'],
	$config['facebook']['callback_url'],
	$config['facebook']['permissions']
);
$accessToken = $login->getToken();
if (isset($accessToken)) {
    $_SESSION['facebook_access_token'] = (string) $accessToken;
    echo "User logged in!"
} else {
    echo "Not logged in: ". $_COOKIE['facebook_message'] . "\n";
}

```

Usage: Making calls to Facebook Graph API
-----------------------------------------

[](#usage-making-calls-to-facebook-graph-api)

When we have an access\_token, we are able to make graph API calls.

```
try {
	$response = $login->fb->get(
		'/me',
		$_SESSION['facebook_access_token']
  	);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
	echo $e->getMessage();
} catch(Facebook\Exceptions\FacebookSDKException $e) {
	echo $e->getMessage();
}
$retValue = $response->getGraphUser();
print_r($retValue);

```

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

[](#contributing)

License
-------

[](#license)

Open source.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you have found a security issue, please contact the maintainers directly at .

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance71

Regular maintenance activity

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~311 days

Recently: every ~622 days

Total

9

Last Release

165d ago

Major Versions

v1.0.9 → v2.0.02025-11-27

PHP version history (2 changes)v1.0.0PHP &gt;=5.5.0

v2.0.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c70e98726c83d1bddf29e3138f463ded6ac3d841584f1c69296a4e64bde76e6?d=identicon)[grippo](/maintainers/grippo)

---

Top Contributors

[![grippo](https://avatars.githubusercontent.com/u/52226?v=4)](https://github.com/grippo "grippo (32 commits)")

---

Tags

facebookloginphpserver-to-server

### Embed Badge

![Health badge](/badges/grippo-fb-php-server-login/health.svg)

```
[![Health](https://phpackages.com/badges/grippo-fb-php-server-login/health.svg)](https://phpackages.com/packages/grippo-fb-php-server-login)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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