简体   繁体   English

InvalidConfigurationException:必须配置路径“ security.firewalls.main.remember_me”处的子节点“ key”

[英]InvalidConfigurationException: The child node “key” at path “security.firewalls.main.remember_me” must be configured

I tried to update my vendor bundles in symfony2 using php composer.phar update, but when I did so I received an error after this line: 我尝试使用php composer.phar更新来更新symfony2中的供应商捆绑包,但是当我这样做时,在此行之后收到错误消息:

Updating the "app/config/parameters.yml" file 更新“ app / config / parameters.yml”文件

The error I get is: 我得到的错误是:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]           
The child node "key" at path "security.firewalls.main.remember_me" must be configured. 

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

[RuntimeException]                                                         
An error occurred when executing the "'cache:clear --no-warmup'" command. 

My security.yml file has the following in its firewall section: 我的security.yml文件的防火墙部分中包含以下内容:

firewalls:
    main:
        pattern: ^/
        provider: fos_userbundle
        form_login:
            csrf_provider: form.csrf_provider
            always_use_default_target_path: false
            default_target_path: webplio_site_dashboard_index
            #success_handler: webplio_site.login_success_handler
            check_path: /login_check
            login_path: /login
        logout: true
        remember_me: true
        anonymous: true
        remember_me:
            key: "%secret%"
            lifetime: 31536000 # 365 days in seconds
            path: /
            domain: ~ # Defaults to the current domain from $_SERVER

where secret is defined in my parameters.yml file 我的parameters.yml文件中定义了秘密的地方

My question then is what else do I need to do in order to configure the child node "key" at path "security.firewalls.main.remember_me"? 那么我的问题是,要在路径“ security.firewalls.main.remember_me”上配置子节点“ key”,我还需要做什么?

You need to change from 您需要从

remember_me:
    key: "%secret%"

to

remember_me:
    secret: "%secret%"

Move your remember_me: true to 移动您的remember_me: true

form_login:
    ...
    remember_me: true

Check the security-reference as to see why. 检查安全性参考以了解原因。

将密钥更改为秘密即可使用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 必须配置路径“security.firewalls.main.remember_me”中的子节点“secret” - The child node “secret” at path “security.firewalls.main.remember_me” must be configured FOSOAuthServerBundle-必须配置路径“ security”处的子节点“ providers” - FOSOAuthServerBundle - The child node “providers” at path “security” must be configured 必须配置路径“安全性”下的子节点“提供者” SonataAdmin FosUser - The child node “providers” at path “security” must be configured SonataAdmin FosUser 必须配置路径“enqueue_elastica”处的子节点“transport” - The child node "transport" at path "enqueue_elastica" must be configured 安装QCMBundle - 必须配置子节点“驱动程序” - Installing QCMBundle - The child node “driver” must be configured FOSUser Bundle必须配置路径“fos_user”中的子节点“db_driver” - FOSUser Bundle The child node “db_driver” at path “fos_user” must be configured 必须配置路径“fos_user”的子节点“db_driver” - The child node “db_driver” at path “fos_user” must be configured 路径“ security.firewalls.main.form_login”的类型无效。 预期的数组,但有字符串 - Invalid type for path “security.firewalls.main.form_login”. Expected array, but got string Symfony 4-必须配置路径“ beelab_tag”上的子节点“ tag_class” - Symfony 4 - The child node “tag_class” at path “beelab_tag” must be configured 停滞的RedKiteCMS安装:“必须配置路径“ fos_user”处的子节点“ db_driver” - Stalled RedKiteCMS install: “The child node ”db_driver“ at path ”fos_user“ must be configured”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM