Symfony 2.8 http_digest抛出DaoAuthenticationProvider错误

时间:2016-01-26 19:59:35

标签: php symfony

希望我在这里遗漏了一些东西。

以下security.yml文件在Symfony 2.3中无问题。但是,升级到Symfony 2.8会引发此错误:

Argument 2 passed to Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider::__construct() must be an instance of Symfony\Component\Security\Core\User\UserCheckerInterface

我在新安装的Symfony 2.8.2和2.3上测试了这一点,只更改了security.yml文件。

security.yml

security:
    providers:
        my_in_memory_provider:
            memory: 
                users:
                    foo:
                        password: foo
                        roles: ROLE_USER
                    bar:
                        password: bar
                        roles: [ROLE_USER, ROLE_ADMIN]

    firewalls:
        # disables authentication for assets and the profiler, adapt it according to your needs
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

        api:
            pattern: ^/api
            http_digest:
              key: %secret%
            anonymous: false

我已经检查了从2.3到2.8的升级路径,没有任何东西突然出现在我看来显然是问题所在。然而,在网上搜索这个问题却没有提起太多,所以我猜我错过了什么?

1 个答案:

答案 0 :(得分:1)

最终发现这是Symfony 2.8中的一个错误。

此处已修复https://github.com/symfony/symfony/pull/17559