Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony安全性上的重定向循环_Php_Symfony - Fatal编程技术网

Php Symfony安全性上的重定向循环

Php Symfony安全性上的重定向循环,php,symfony,Php,Symfony,我对Symfony还不熟悉。因此,我的工作中有一项任务是创建一个 传统的登录形式。因此,我在security.yml上创建了防火墙和访问控制,命名为main,如下所示: firewalls: # disables authentication for assets and the profiler, adapt it according to your needs profiler1: pattern: ^/_profiler security:

我对Symfony还不熟悉。因此,我的工作中有一项任务是创建一个 传统的登录形式。因此,我在security.yml上创建了防火墙和访问控制,命名为main,如下所示:

firewalls:
    # disables authentication for assets and the profiler, adapt it according to your needs
    profiler1:
        pattern: ^/_profiler
        security: false
        anonymous: true

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

    gos_websocket:
        pattern: ^/channel
        security: false

    oauth_token:
      pattern:    ^/oauth/v2/token
      security:   false

    api_doc:
      pattern:  ^/api/doc
      security: false

    oauth_authorize:
      pattern:    ^/oauth/v2/auth
      security:   false

    api:
      pattern:    ^/api
      fos_oauth:  true
      stateless:  true
      anonymous:  false

    main:
        pattern:    ^/
        #stateless: false
        #simple_preauth:
        #    authenticator: apikey_authenticator
        #provider: api_key_account_provider
        provider: ms.user_provider
        logout:
            path: /security/logout
            target: /security/login
        form_login:
            login_path: /security/login
            check_path: /security/check-login
            default_target_path: /dashboard
            always_use_default_target_path: true

   #anonymous: true

   # activate different ways to authenticate


   # http_basic: ~
   # http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate


   # form_login: ~
   # http://symfony.com/doc/current/cookbook/security/form_login_setup.html
access_control:
    #- { path: ^/api, roles: IS_AUTHENTICATED_FULLY }
    # - { path: ^/, roles: IS_AUTHENTICATED_FULLY }
    - { path: ^/security/login, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/, roles: IS_AUTHENTICATED_FULLY }
当我试图访问安全/登录URL时,它说它遇到了太多重定向?为什么会这样

谢谢

你错过了一个“s”


仍然没有修复,我之所以这么做是为了在防火墙上添加匿名:true。
- { path: ^/security/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }