I am trying to use a custom password encryptin in my symfony2 project.
I have a problem with setting the security:
security:
encoders:
Symfony\Component\Security\Core\User\User:
id: custom_encoder
providers:
main:
entity: { class: MDPI\BackendBundle\Entity\Users, property: email }
firewalls:
main:
pattern: ^/
anonymous: ~
form_login:
login_path: /login
check_path: /login_check
access_control:
- { path: /admin/.*, role: ROLE_ADMIN }
- { path: /.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
Here, I am getting the exception:
InvalidConfigurationException: Unrecognized options "main" under "security.encoders.providers"
Any help is wellcome. Thanks a lot.
I resolved the problem, there were some extra spaces in my security.yml that I deleted. Spaces have to be managed with care it this file !!!