PHPackages                             junker/hybridauth-service-provider - 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. junker/hybridauth-service-provider

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

junker/hybridauth-service-provider
==================================

Silex HybridAuth Service Provider

241PHP

Since Jun 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Junker/HybridAuthServiceProvider)[ Packagist](https://packagist.org/packages/junker/hybridauth-service-provider)[ RSS](/packages/junker-hybridauth-service-provider/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

HybridAuthServiceProvider
=========================

[](#hybridauthserviceprovider)

HybridAuth Service Provider for Silex

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

[](#requirements)

silex 1.x

\##Installation The best way to install HybridAuthServiceProvider is to use a [Composer](https://getcomposer.org/download):

```
php composer.phar require junker/hybridauth-service-provider

```

Examples
--------

[](#examples)

```
use Junker\Silex\Provider\HybridAuthServiceProvider;

$app->register(new HybridAuthServiceProvider(), [
	'hybridauth.config' => [
		'providers' => [
		    'Facebook' => [
		        'enabled' => true,
		        'keys' => [
		            'id' => 1090817398,
		            'secret' => 'c9131f36717babbasdafewrfdase'
		        ],
		        'scope' => 'public_profile,email,user_birthday,user_location'
		    ],
		    'Twitter' => [
		        'enabled' => true,
		        'keys' => [
		            'key' => 'wwqKLOHNhequwhe',
		            'secret' => 'hiwedfrwe4trDKkVyIHiBdceN4Ed1ASDWdsfarewREFRtMk'
		        ]
		    ]
		]
	]
]);

$app->get('/login/{provider}', function($provider) use ($app) {

	$adapter = $app['hybridauth']->authenticate($provider);

	$user_profile = $adapter->getUserProfile();

	if ($user_profile)
	{
		$uid = $user_profile->identifier;
		$login = $app['db']->fetchColumn('SELECT login FROM user WHERE oauth_type=? AND oauth_uid=?', [$provider, $uid]);

		if ($login)
		{
			//force login. i.e.:
			$user_provider = new \MySite\UserProvider($app['db']);
			$user = $user_provider->loadUserByUsername($login);
			$token = new UsernamePasswordToken($user, NULL, 'main', $user->getRoles());
			$app['security']->setToken($token);

			return $app->redirect('/');
		}
		else
		{
			//redirect to registration
			...
		}
	}
});
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/1144095?v=4)[Dmitry Kosenkov](/maintainers/Junker)[@Junker](https://github.com/Junker)

### Embed Badge

![Health badge](/badges/junker-hybridauth-service-provider/health.svg)

```
[![Health](https://phpackages.com/badges/junker-hybridauth-service-provider/health.svg)](https://phpackages.com/packages/junker-hybridauth-service-provider)
```

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