php – 防火墙模式不匹配登录方法的check_path

我正在为Symfony2上的登录表单配置安全层,但是这个错误不断出现:

InvalidConfigurationException: Invalid configuration for path 
"security.firewalls.gestor_area": The check_path "^/ES/gestor/login_check" 
for login method "form_login" is not matched by the firewall pattern "^/ES/gestor".

security.yml的相关部分是:

firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false

    gestor_area:
        pattern: ^/ES/gestor
        http_basic: ~
        provider: db
        form_login:
            login_path: weblogin_login
            check_path: ^/ES/gestor/login_check

    access_control: 
           - { path: ^/ES/gestor, roles: ROLE_ADMIN } 
           - { path: weblogin_login, roles: IS_AUTHENTICATED_ANONYMOUSLY } 
           - { path: ^/ES/gestor/login_check, roles: IS_AUTHENTICATED_ANONYMOUSLY } 
           - { path: ^/PT/project, roles: ROLE_ADMIN } 
           - { path: ^/FR/project, roles: ROLE_ADMIN } 
           - { path: ^/CL/project, roles: ROLE_ADMIN } 
           - { path: ^/ES/project, roles: ROLE_ADMIN } 
           - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }

使它完全工作http autentification – 也显示登录表单,但当我尝试使用登录表单进行身份验证时崩溃,或者它只是显示此错误.

如何设置与防火墙模式匹配的路由?

更新:
添加了访问控制的路径,仍然无法正常工作,同样的错误.

最佳答案 有一个拼写错误:

The check_path “^/ES/gestor/login_check”

此check_path应该是纯文本路径而不是正则表达式模式.即在你的情况下省略^字符.

点赞