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

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

m6web/domain-user-bundle
========================

User authentication by domain

v3.0.0(6y ago)9115.6k5MITPHP

Since Jan 8Pushed 5y ago28 watchersCompare

[ Source](https://github.com/BedrockStreaming/DomainUserBundle)[ Packagist](https://packagist.org/packages/m6web/domain-user-bundle)[ RSS](/packages/m6web-domain-user-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (0)

DomainUserBundle [![Build Status](https://camo.githubusercontent.com/8bcf7da25da9ba414172fe828af3e7810f2b4d1312a1d8106be0b3ffc167e1bd/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4d365765622f446f6d61696e5573657242756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/M6Web/DomainUserBundle)
===============================================================================================================================================================================================================================================================================================================================

[](#domainuserbundle-)

DomainUserBundle provides user authentication by subdomain. It allows firewalling, cache customization, route filtering and data filtering by subdomain.

Dependency
----------

[](#dependency)

DomainUserBundle requires [FirewallBundle](https://github.com/m6web/FirewallBundle).

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

[](#installation)

Add this line in your composer.json:

```
{
    "require": {
        "m6web/domain-user-bundle": "~1.0"
    }
}
```

Update your vendors:

```
$ composer update m6web/domain-user-bundle
```

Add to your `AppKernel.php`:

```
new M6Web\Bundle\DomainUserBundle\M6WebDomainUserBundle(),
new M6Web\Bundle\FirewallBundle\M6WebFirewallBundle(),
```

Configuration
-------------

[](#configuration)

Modify your routes to add a parameter in your host requirement:

```
routes:
    resource: api_routing.yml
    host:     {client}api.example.com
    requirements:
        client: ([a-z0-9]+\.)?
    defaults:
        client ""
```

Add in your `app/config.yml`:

```
m6_web_domain_user:
    default_cache:    300      # Default cache duration
    router_parameter: client   # Parameter in the host requirement
    default_user:     public   # User when the parameter is not found
    users_dir:        %kernel.root_dir%/config/users # Directory containing the user configs
    firewall:
        allow_debug_route: false # Allows or not (default) web debug toolbar routes for the concerned environment
```

Add a user `app/config/users/public.yml`:

```
firewall:
    user_access: # Configure IP restrictions with FirewallBundle
        default_state: false
        lists:
            internal: true

    allow: # Filter routes alllowed to this user
        default: true
        methods:
            delete: false # Override by method
        resources:
            article: false # Override by routes configured with "defaults: {resource: article}"
        route:
            post_comment: false # Override by route name
        allow_debug_route: false # Allows or not (default) web debug toolbar routes for this user

cache:
    defaults: 60 # Override the default cache duration
    routes:
        hello: 86400 # Override by route name

entities:
    article:
        active: true # Arbitrary flag you can use to filter your entities in your repositories
parameters:
    param_name: param_value # Arbitrary parameters
```

Edit your `app/config/security.yml`:

```
security:
    firewalls:
        secured_area:
            pattern:            ^/
            anonymous:          false
            m6_web_domain_user: true

    providers:
        m6_web_domain_user:
            id: m6_web_domain_user.user_provider
```

Tests
-----

[](#tests)

```
$ ./vendor/bin/atoum
```

Credits
-------

[](#credits)

Developped by the [Cytron Team](http://cytron.fr/) of [M6 Web](http://tech.m6web.fr/). Tested with [atoum](http://atoum.org).

License
-------

[](#license)

DomainUserBundle is licensed under the [MIT license](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~295 days

Total

16

Last Release

2408d ago

Major Versions

v1.1.1 → v2.0.02015-06-17

v2.3.4 → v3.0.02019-11-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2069361?v=4)[Patrick](/maintainers/Bedrock)[@Bedrock](https://github.com/Bedrock)

---

Top Contributors

[![KuiKui](https://avatars.githubusercontent.com/u/748924?v=4)](https://github.com/KuiKui "KuiKui (10 commits)")[![omansour](https://avatars.githubusercontent.com/u/1131098?v=4)](https://github.com/omansour "omansour (4 commits)")[![lolautruche](https://avatars.githubusercontent.com/u/313528?v=4)](https://github.com/lolautruche "lolautruche (3 commits)")[![titoko](https://avatars.githubusercontent.com/u/1798254?v=4)](https://github.com/titoko "titoko (2 commits)")[![Oliboy50](https://avatars.githubusercontent.com/u/2571084?v=4)](https://github.com/Oliboy50 "Oliboy50 (2 commits)")[![adriensamson](https://avatars.githubusercontent.com/u/520234?v=4)](https://github.com/adriensamson "adriensamson (2 commits)")[![mojoLyon](https://avatars.githubusercontent.com/u/797786?v=4)](https://github.com/mojoLyon "mojoLyon (1 commits)")[![fabdsp](https://avatars.githubusercontent.com/u/5878620?v=4)](https://github.com/fabdsp "fabdsp (1 commits)")[![jubianchi](https://avatars.githubusercontent.com/u/327237?v=4)](https://github.com/jubianchi "jubianchi (1 commits)")[![jdlabails](https://avatars.githubusercontent.com/u/8875327?v=4)](https://github.com/jdlabails "jdlabails (1 commits)")

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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