I've a problem with my security.yml
using Symfony 2.
This is the content of my file :
security:
encoders:
MOD\UserBundle\Entity\User:
algorithm: sha512
iterations: 1
encode_as_base64: false
role_hierarchy:
#[...]
providers:
user_db:
entity:
class: MOD\UserBundle\Entity\User
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/user/login$
anonymous: true
main:
pattern: ^/
anonymous: false
provider: user_db
form_login:
login_path: user_login
check_path: user_check
logout:
path: user_logout
target: /user/login
I have an entity called User, with fields : id, email, username, password, salt, roles
When I try to log me on from /user/login
the result is always the same : "Bad credentials"
.
Is there a way to check what happened on user_check
request? Or any apparent mis-configuration in the security.yml
?
This is what I get in app/logs/dev.log
:
[2014-02-09 21:35:27] doctrine.DEBUG: SELECT t0.id AS id1, t0.username AS username2, t0.password AS password3, t0.salt AS salt4, t0.email AS email5, t0.roles AS roles6 FROM User t0 WHERE t0.username = ? LIMIT 1 ["Maxime"] []
[2014-02-09 21:35:27] security.INFO: Authentication request failed: Bad credentials [] []
In my databse I have just one user with the username : Maxime