Question

I'm using Symfony 2.1-dev and am having problems when authenticate users using a form.

First of all my code

The problem:
When authenticating I get "Wrong credentials" error.
I put some logging into the entity and as the logged string does not show up I suppose that the entity is not being used.
Anyway, the log shows that a query is being made to the correct table.

What can I be missing?

Thanks in advance for any help

Edit:

I now managed to find out that the problem is the password.
For some reason it seems that when encoding the password from the fixtures, these get shortened to 60 chars, while when authenticating the length of the resulting string is 88 chars.
Why could that be?

Was it helpful?

Solution

Finally it worked. I updated the length of the password field. At first it didn't work, but suddenly after while it did. Must be something with caching.

Things I've learned and maybe of benefit to other readers:

  • The __construct method of the entity does not get executed. I suppose that the class is being subclassed. Therefor logging in the constructor does nothing.
  • Take care of cache... I had tried the final solution before but as it didn't work I looked for other issues and spent a whole day on it.
  • This kind of problems help you get into the internals of Symfony :-)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top