Bonjour,
Dans mon security.yml, j'ai 2 firewalls : un pour le front-office et un pour le back-office.

J'aimerais interdire aux utilisateurs back-office de se connecter au front-office (sachant que certaines pages du front-office sont accessible anonymement)

Voici mon security.yml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#security:
#    encoders:
#        Symfony\Component\Security\Core\User\User: plaintext
#
#    role_hierarchy:
#        ROLE_ADMIN:       ROLE_USER
#        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
#
#    providers:
#        in_memory:
#            users:
#                user:  { password: userpass, roles: [ 'ROLE_USER' ] }
#                admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
#
#    firewalls:
#        dev:
#            pattern:  ^/(_(profiler|wdt)|css|images|js)/
#            security: false
#
#        login:
#            pattern:  ^/demo/secured/login$
#            security: false
#
#        secured_area:
#            pattern:    ^/demo/secured/
#            form_login:
#                check_path: /demo/secured/login_check
#                login_path: /demo/secured/login
#            logout:
#                path:   /demo/secured/logout
#                target: /demo/
            #anonymous: ~
            #http_basic:
            #    realm: "Secured Demo Area"
 
#    access_control:
        #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
        #- { path: ^/_internal, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
 
## Configuration de la sécurité par defaut !!
 
# app/config/security.yml
security:
    providers:
        fos_userbundle:
            id: fos_user.user_manager
 
    encoders:
        FOS\UserBundle\Model\UserInterface: sha512
        projet\UserBundle\Entity\User: sha512
 
    firewalls:
      # /!\ L'ordre d'apparition des firewalls importe !!
      # firewall permettant l'accès à la barre de dev
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main_bo:
            pattern: ^/back_office
            form_login:
                provider: fos_userbundle
                login_path: /back_office/login
                check_path: /back_office/login_check
            anonymous:    ~
            logout:
                path:   /back_office/logout
                target: /back_office
      # firewall du front office
        main:
            pattern: ^/
            form_login:
                provider: fos_userbundle
                login_path: /login
                check_path: /login_check
            anonymous:    ~
            logout:
                path:   /logout
                target: /
 
    access_control:
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/back_office/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/back_office/.*, roles: [ROLE_SUPER_ADMIN, ROLE_ADMIN, ROLE_RESPONSABLE, ROLE_GESTIONNAIRE] }
        - { path: ^/questions_reponses, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/mentions_legales, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/conditions_generales, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/plan_site, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/contact, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/.*, role: ROLE_LOCATAIRE }
 
    role_hierarchy:
        ROLE_LOCATAIRE:    ROLE_USER
        ROLE_RESPONSABLE:  ROLE_USER
        ROLE_GESTIONNAIRE: ROLE_USER
        ROLE_ADMIN:        ROLE_USER
        ROLE_SUPER_ADMIN:  ROLE_ADMIN
Comment puis-je interdire à mes utilisateurs back-office de se connecter sur le front-office ?

Merci d'avance