I am new to Symfony and I am trying out different examples shown in Symfony. However, I get the following error with my security.yml file
InvalidConfigurationException in SecurityExtension.php line 430: No authentication listener registered for firewall "secured_area".
My security.yml file looks like this
security:
providers:
in_memory:
memory:
users:
foo:
password: $2a$12$2nJYjp5DxX0o.ZgGL8ybEOG/MepViC08G1HKVFpjb0BoTDiZd9bCq
roles: ROLE_ADMIN
firewalls:
secured_area:
logout:
path: /logout
target: /example
dev:
pattern: ^/(_(profiler|wdt|error)|css|images|js)/
security: false
default:
anonymous: ~
http_basic: ~
access_control:
- { path: ^/administer, roles: ROLE_ADMIN }
encoders:
Symfony\Component\Security\Core\User\User:
algorithm: bcrypt
cost: 12
Each firewalls key must have defined one or more authentication provider (anonymous, form_login etc.) unless it contains security: false
. Your secured_area has registered nothing (logout is not for authentication). Deleting secured_area or moving logout under default key should solve the problem. Right solution depends on what you are trying to achieve.
firewalls:
dev:
pattern: ^/(_(profiler|wdt|error)|css|images|js)/
security: false
default:
anonymous: ~
http_basic: ~
A "little bit" similar problem security.yml causes InvalidArgumentException: "You must at least add one authentication provider".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With