PHPackages                             fatigba/symfony-social-login-bundle - 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. fatigba/symfony-social-login-bundle

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

fatigba/symfony-social-login-bundle
===================================

Un bundle symfony simple pour se connecter avec des fournisseurs OAuth2 (Google, Facebook, ... etc).

v0.0.4(4y ago)02MITPHPPHP ^7.1.3

Since Feb 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/BlackPowerC/Symfony-SocialLoginBundle)[ Packagist](https://packagist.org/packages/fatigba/symfony-social-login-bundle)[ RSS](/packages/fatigba-symfony-social-login-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (5)Used By (0)

Comment utiliser ce bundle
==========================

[](#comment-utiliser-ce-bundle)

Installation

```
composer require fatigba/symfony-social-login-bundle
```

Configuration des bundles
-------------------------

[](#configuration-des-bundles)

Dans votre fichier de configuration `config/bundles.php`, ajouter les entrées suivantes:

```
KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true]
```

```
JFK\SocialLogin\SocialLoginBundle::class => ['all' => true]
```

Configuration des fournisseurs OAuth2
-------------------------------------

[](#configuration-des-fournisseurs-oauth2)

Créer le fichier `config/packages/knpu_oauth2_client.yaml` s'il n'existe pas.
Ajoutez y ensuite les lignes suivantes:

```
knpu_oauth2_client:
	clients:
```

### Le cas de Google

[](#le-cas-de-google)

Pour configurer le client OAuht2 de Google, veuillez ajouter ce qui suit dans votre fichier de configuration,

```
knpu_oauth2_client:
	clients:
		google:
			type: google
			client_id: xxxx
			client_secret: xxxx
			redirect_route: connect_google_check
```

Vous obtiendrez des valeurs pour client\_id et client\_secret en créant un `ID client OAuth`.
[Console Google](https://console.developers.google.com) --&gt; `API et Services` --&gt; `Identifiants` --&gt; `Créer des identifiants` --&gt; `ID client OAuth`

Injection de dépendances et découverte de services
--------------------------------------------------

[](#injection-de-dépendances-et-découverte-de-services)

Il s'agit de donner, impérativement un alias aux guards et de permettre l'injection de dépendances dans les controlleurs du bundles

`config/services.yaml`

```
services:
	JFK\SocialLogin\Google\Controller\:
        resource: '../vendor/fatigba/symfony-social-login-bundle/src/SocialLogin/Google/Controller'
        tags: ['controller.service_arguments']
    .................
    .................
    .................
	jfk.sociallogin.google:
		class: JFK\SocialLogin\Google\Security\GoogleAuthenticator
```

Ensuite pour activer la détection des routes du controlleur, il faut activer la détection des routes dans `routes/annotations.yaml`:

```
google_social_login_controllers:
    resource: ../../vendor/fatigba/symfony-social-login-bundle/src/SocialLogin/Google/Controller
    type: annotation
```

Configuration de la sécurité
----------------------------

[](#configuration-de-la-sécurité)

### Les guard

[](#les-guard)

La recherche de l'utilisateur symfony se fait sur l'email en utilisant FOSUser. Les classes de guard sont:

```
JFk\SocialLogin\Google\Security\GoogleAuthenticator
```

En cas d'échec on est rediriger vers l'url `/login`

### Le fichier security.yaml

[](#le-fichier-securityyaml)

Dans le firewall adéquats, ajoutez les guards dont vous avez besoin:

```
guard:
	authenticators:
		- jfk.sociallogin.google
```

Ajouter les controles d'accès suivants:

```
access_control:
	- { path: ^/sociallogin/google, role: IS_AUTHENTICATED_ANONYMOUSLY }
```

Les controlleurs de connexion
-----------------------------

[](#les-controlleurs-de-connexion)

### Le cas de Google (JFk\\SocialLogin\\Google\\Controller)

[](#le-cas-de-google-jfksociallogingooglecontroller)

Ce controlleur contient deux routes:

```
@Route("/sociallogin/google", name="connect_google")
```

Cette route fait une redirection vers la page d'authentification de google.

```
@Route("/sociallogin/google/check", name="connect_google_check")
```

C'est la route vers laquelle il faut faire la redirection après l'authentification de google.
Elle se charge de connecter l'utilisateur symfony et de le rediriger vers la route `homepage`.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Total

4

Last Release

1555d ago

PHP version history (2 changes)v0.0.1PHP ^7.4

v0.0.2PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fb4e5e5049e84bd319488bcc963102dd47606b0e919c2e237a6108360a03c29?d=identicon)[jojo.fatigba](/maintainers/jojo.fatigba)

### Embed Badge

![Health badge](/badges/fatigba-symfony-social-login-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/fatigba-symfony-social-login-bundle/health.svg)](https://phpackages.com/packages/fatigba-symfony-social-login-bundle)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[klapaudius/oauth-server-bundle

Symfony(5.x to 8.x) OAuth Server Bundle

15547.3k2](/packages/klapaudius-oauth-server-bundle)[chameleon-system/chameleon-base

The Chameleon System core.

1026.5k3](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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