PHPackages                             gupalo/google-auth-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. gupalo/google-auth-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

gupalo/google-auth-bundle
=========================

Google Auth Bundle

1.7.0(3y ago)49.2kMITPHPPHP &gt;=8.1

Since Mar 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/gupalo/google-auth-bundle)[ Packagist](https://packagist.org/packages/gupalo/google-auth-bundle)[ RSS](/packages/gupalo-google-auth-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (57)Used By (0)

Google Auth Bundle
==================

[](#google-auth-bundle)

Implementation of common authentication logic

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

[](#installation)

Get Google App id and secret at

Add env vars:

- `GOOGLE_AUTH_APP_ID`: from Google Console
- `GOOGLE_AUTH_APP_SECRET`: from Google Console
- `GOOGLE_AUTH_DOMAIN`: which domain is allowed to login; 'user.dev' to skip google auth and login all as ROLE\_USER; "\*" if all domains (only GSuite); override `google_auth_domain: null` if you need to allow really all domains including "gmail.com"
- `GOOGLE_AUTH_USERS`: which users should be autoactivated; empty if no users
- `GOOGLE_AUTH_ADMINS`: which users should be autoactivated as admins; empty if none
- `GOOGLE_AUTH_DEFAULT_APIKEY`: set if you want to autocreate "" user with this key

And create `config/packages/google_auth.yaml`

```
parameters:
    env(GOOGLE_AUTH_APP_ID): something.apps.googleusercontent.com
    env(GOOGLE_AUTH_APP_SECRET): your_secret
    env(GOOGLE_AUTH_DOMAIN): "*"
    env(GOOGLE_AUTH_USERS): user1,user2
    env(GOOGLE_AUTH_ADMINS): user1,user2
    env(GOOGLE_AUTH_DEFAULT_APIKEY): ''

    google_auth_app_id: '%env(string:GOOGLE_AUTH_APP_ID)%'
    google_auth_app_secret: '%env(string:GOOGLE_AUTH_APP_SECRET)%'
    google_auth_domain: '%env(string:GOOGLE_AUTH_DOMAIN)%'
    google_auth_users: '%env(string:GOOGLE_AUTH_USERS)%'
    google_auth_admins: '%env(string:GOOGLE_AUTH_ADMINS)%'
    google_auth_default_apikey: '%env(string:GOOGLE_AUTH_DEFAULT_APIKEY)%'
```

Install

```
composer require gupalo/google-auth-bundle
```

2. Check that **GoogleAuthBundle** and **KnpUOAuth2ClientBundle** are in `config/bundles.php`

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

```

3. Set `config/packages/security.yaml`

```
security:
    encoders:
        Symfony\Component\Security\Core\User\User:
            algorithm: bcrypt

    providers:
        database_users:
            entity: { class: 'Gupalo\GoogleAuthBundle\Entity\User', property: username }

    role_hierarchy:
        ROLE_USER: [ROLE_API]

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false
        healthcheck:
            pattern:  ^/healthcheck
            security: false
        api:
            pattern: ^/api/
            anonymous: false
            stateless: true
            guard:
                authenticators: ['google_auth.security.google_authenticator']
                entry_point: google_auth.security.google_authenticator
            provider: database_users
        main:
            pattern: ^/
            logout:
                path: google_auth_security_logout
                target: homepage
            anonymous: true
            guard:
                authenticators: ['google_auth.security.google_authenticator']
                entry_point: google_auth.security.google_authenticator
            provider: database_users
            remember_me:
                secret: "%secret%"
                lifetime: 31536000 # 365 days in seconds
                path: /
                domain: ~ # Defaults to the current domain from $_SERVER
                #always_remember_me: true
    access_control:
        - { path: ^/auth/, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api/, roles: ROLE_API }
        - { path: ^/, roles: ROLE_USER }
```

4. Enable GoogleAuthBundle routing. Add to `config/routes/google_auth.yaml`

```
google_auth:
    resource: "@GoogleAuthBundle/Resources/config/routing/routing.yaml"
```

5. Create `config/packages/google_auth.yaml`

```
imports:
    - {resource: '@GoogleAuthBundle/Resources/config/services.yaml'}
```

6. Update your database schema

Dev
---

[](#dev)

Set to GOOGLE\_AUTH\_DOMAIN to one of the values below for dev environment

- user.dev - to login as \[User::ROLE\_USER\]
- manager.dev - \[User::ROLE\_MANAGER\]
- admin.dev - \[User::ROLE\_ADMIN\]
- user-admin.dev - \[User::ROLE\_USER, User::ROLE\_ADMIN\]

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 85.4% 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 ~20 days

Recently: every ~87 days

Total

53

Last Release

1217d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.6.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/df3e7060fb5777768e7bb133e98b1e7dfcc788f25fe6dc445acf7036da5c0c3e?d=identicon)[luchaninov](/maintainers/luchaninov)

---

Top Contributors

[![luchaninov](https://avatars.githubusercontent.com/u/3829796?v=4)](https://github.com/luchaninov "luchaninov (41 commits)")[![Okspen](https://avatars.githubusercontent.com/u/388928?v=4)](https://github.com/Okspen "Okspen (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gupalo-google-auth-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gupalo-google-auth-bundle/health.svg)](https://phpackages.com/packages/gupalo-google-auth-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[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)
