PHPackages                             connectholland/user-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. connectholland/user-bundle

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

connectholland/user-bundle
==========================

User bundle for Symfony 4 projects

4.0.6(1mo ago)84.3k8[2 issues](https://github.com/Harborn-digital/user-bundle/issues)[1 PRs](https://github.com/Harborn-digital/user-bundle/pulls)MITPHPPHP ^8.1

Since Dec 2Pushed 1mo ago14 watchersCompare

[ Source](https://github.com/Harborn-digital/user-bundle)[ Packagist](https://packagist.org/packages/connectholland/user-bundle)[ RSS](/packages/connectholland-user-bundle/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (95)Versions (38)Used By (0)

Connect Holland User Bundle
===========================

[](#connect-holland-user-bundle)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0e09f334de0b0306e3ae6ff1f08fe23306512055003a9ecd2768713319e03b5a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6e6e656374486f6c6c616e642f757365722d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ConnectHolland/user-bundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/22be2f5c46ae76e08f76e3b69668c3c8d968b3990a2233d180a54c4cb04b5088/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6e6e656374486f6c6c616e642f757365722d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ConnectHolland/user-bundle/?branch=master)[![Build Status](https://camo.githubusercontent.com/92dcbbfac3e4db515d5cb7e441776430f7b219943e86c32505d3b03791fc011e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6e6e656374486f6c6c616e642f757365722d62756e646c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ConnectHolland/user-bundle/build-status/master)

User bundle for Symfony 4.4 and 5 projects

Functionality
-------------

[](#functionality)

This bundle will be extendible and provide:

- Simple registration form
- Simple login form
- A Command to create users with their roles
- An e-mail message with a secure link to complete account registration
- Recover password functionality
- Ability to 'switch on' OAuth (Google/GitHub/Facebook/etc)
- Being API accessable
- Ability to 'switch on' MFA

Environment
-----------

[](#environment)

Set the environment variables to be able to send e-mails.

```
USERBUNDLE_FROM_EMAILADDRESS=example@example.com
```

Create a user
-------------

[](#create-a-user)

To create a new user run:

```
./bin/console connectholland:user:create example@example.com p@$$w0rd --role=ROLE_USER
```

OAuth
-----

[](#oauth)

If the app needs OAuth login the HWI OAuth bundle should be required and suitable configuration should be added.

Install the bundle:

```
composer require hwi/oauth-bundle
```

Uncomment the oauth include in the routing.

Add environment variables to enable a specific OAuth provider (resource). E.g. for google:

```
USERBUNDLE_OAUTH_GOOGLE_ID=xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
USERBUNDLE_OAUTH_GOOGLE_SECRET=XXXXXXXXXXX-xx_xx_xxxxx
USERBUNDLE_OAUTH_GOOGLE_SCOPE='email profile'
# Options specific for the provider can be added in a json encoded string like below.
USERBUNDLE_OAUTH_GOOGLE_OPTIONS={"hd": "connectholland.nl"}
```

Add (automated) routing configuration:

```
# config/routes/connectholland_user.yaml
connectholland_user_oauth:
    resource: '@ConnecthollandUserBundle/Resources/config/routing_oauth.yaml'
    prefix: '/'
```

JTW Token support
-----------------

[](#jtw-token-support)

If the app needs JTW token support, the Lexik JWT Authentication bundle should be required and suitable configuration should be added.

Intstall the bundle:

```
composer require lexik/jwt-authentication-bundle
```

Generate public and secret keys as described in [Lexik JWT Authentication bunle documentation](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#installation). Set the location of the keys relative to the project root as environment variables `JWT_SECRET_KEY` and `JWT_PUBLIC_KEY` and set the passphrase used as `JWT_PASSPHRASE`

API Support
-----------

[](#api-support)

To add API support, [install the API Platform](https://api-platform.com/docs/core/getting-started/) and [JWT Authentication](https://api-platform.com/docs/core/jwt/#jwt-authentication) configure the firewall and add an authentication route.

```
composer req api-pack jwt-auth
```

```
# Example of the security settings for your project.
# config/packages/security.yaml
    firewalls:
        api_login:
            pattern: ^/api/users/authenticate
            stateless: true
            anonymous: true
            provider: app_user_provider
            json_login:
                check_path:                 /api/users/authenticate
                success_handler:            lexik_jwt_authentication.handler.authentication_success
                failure_handler:            lexik_jwt_authentication.handler.authentication_failure
                require_previous_session:   false

        api:
            pattern: ^/api
            stateless: true
            anonymous: true
            provider: app_user_provider
            json_login:
                check_path:                 /api/users/authenticate
                success_handler:            lexik_jwt_authentication.handler.authentication_success
                failure_handler:            lexik_jwt_authentication.handler.authentication_failure
                require_previous_session:   false
            guard:
                authenticators:
                    - lexik_jwt_authentication.jwt_token_authenticator

    access_control:
        - { path: ^/api/authenticate, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/api, roles: ROLE_USER }
```

```
# config/routes.yaml
api_authenticate:
    path: /api/users/authenticate
```

For example:

```
###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=config/jwt/private.pem
JWT_PUBLIC_KEY=config/jwt/public.pem
JWT_PASSPHRASE=DEVELOPMENT-KSZEW-YHMIE-XWWCL-DBGPQ-MSYCU-RJRWL-UIYBH-TPNXM-GJTVU-BRDQI-XWXHX
###< lexik/jwt-authentication-bundle ###
```

Security configuration example
------------------------------

[](#security-configuration-example)

```
security:
    encoders:
        Symfony\Component\Security\Core\User\UserInterface:
            algorithm: auto

    providers:
        app_user_provider:
            entity:
                class: ConnectHolland\UserBundle\Entity\User
                property: email
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: true
            guard:
                authenticators:
                    - ConnectHolland\UserBundle\Security\UserBundleAuthenticator
            logout:
                path: connectholland_user_logout
            oauth:
                use_forward: false
                resource_owners:
                    # The resource_owners routing postfixes are a composition of the firewall name and the resource name
                    google: connectholland_user_oauth_check_main_google
                    facebook: connectholland_user_oauth_check_main_facebook
                    linkedin: connectholland_user_oauth_check_main_linkedin
                    # etcetera
                login_path: connectholland_user_login
                failure_path: connectholland_user_login
                oauth_user_provider:
                    service: ConnectHolland\UserBundle\Security\OAuthUserProvider

    access_control:
        - { path: ^/(login|inloggen|register|registreren|password-reset|wachtwoord-vergeten), roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: [ROLE_OAUTH, ROLE_ADMIN ] }
```

Extend User entity
------------------

[](#extend-user-entity)

If you want to extend the User entity, you should clone [User](https://github.com/ConnectHolland/user-bundle/blob/master/src/Entity/User.php) and add it as entity in your own project.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 70.8% 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 ~66 days

Recently: every ~2 days

Total

36

Last Release

49d ago

Major Versions

0.3.3 → 1.0.02021-03-11

1.0.0 → 3.0.12021-03-11

0.4.0 → 3.0.02023-08-14

3.x-dev → 4.0.02026-03-11

PHP version history (3 changes)0.1.0PHP ^7.3

3.0.0PHP &gt;=8.2

4.0.0PHP ^8.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/32c77f5ff7ffcce6bdf072dd76718e014643cb4b3083b27ecf1806606a5ce363?d=identicon)[RonRademaker](/maintainers/RonRademaker)

---

Top Contributors

[![reyostallenberg](https://avatars.githubusercontent.com/u/3579090?v=4)](https://github.com/reyostallenberg "reyostallenberg (136 commits)")[![jaapromijn](https://avatars.githubusercontent.com/u/8127722?v=4)](https://github.com/jaapromijn "jaapromijn (24 commits)")[![matthijsch](https://avatars.githubusercontent.com/u/14073380?v=4)](https://github.com/matthijsch "matthijsch (24 commits)")[![IrenePrins](https://avatars.githubusercontent.com/u/32325661?v=4)](https://github.com/IrenePrins "IrenePrins (7 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/connectholland-user-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/connectholland-user-bundle/health.svg)](https://phpackages.com/packages/connectholland-user-bundle)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[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)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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