Firewalls in Symfony2

Is it possible to map firewalls to a given host, for example:

firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false
    admin:
        pattern: ^/
        host: admin.mysite.com
        http_basic:
            provider: in_memory
            realm: 'MySite Admin'
        logout: 
    main:
        pattern: ^/
        anonymous: ~
        form_login:
            provider: fos_userbundle
        ...

Note the fake host option under the administrator’s firewall.

The ability to restrict firewalls to specific hosts makes it easy to use providers based on each node. With different domains, there is no need to worry about overlapping patterns.

+5
source share
2 answers

Host reconfiguration was added in 2.2, firewall support for each host was added in 2.4.

Fabien blog post: http://symfony.com/blog/new-in-symfony-2-4-restrict-security-firewalls-to-specific-hosts

+2
source

, . , , EntryPoint, , . , "" , , .

, , , framework. factory (Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory), , . Symfony .

+1

All Articles