title: using sha512 encoder with symfony2 in_memory security provider
body: <p>I'm trying to configure my symfony2 application to use the sha512 password encoder with the in_memory security provider, but I can't get it to work. I am getting the infamous "Bad credentials" error on login. Unlike most questions here, I do not want to get users from any database. I do not want to use FOSUserBundle. All I want is simply to replace the plaintext passwords in my security.yml with sha512 hashes.</p>
  
  <p>According to <a href="http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password" rel="nofollow">http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password</a> this should be as simple as setting the encoder and replacing the plaintext password with the hash, so that is what I tried to do:</p>
  
  <p>security.yml:</p>
  
  <pre><code>security:
      encoders:
          Symfony\Component\Security\Core\User\User: sha512
  
      providers:
          in_memory:
              memory:
                  users:
                      admin: { password: $6$randomsalt$mbd3sS15ibE.W7hkLqfQ0LNEQsUod7BOUD67g/oIb8uhqGfyAzaga3vgGaRJZn67VdHHfn.tnkKY9ffDVXw3C., roles: [ 'ROLE_ADMIN' ] }
  </code></pre>
  
  <p>The password is "admin", the salt is "randomsalt" and the hash was generated by mkpasswd:</p>
  
  <pre><code>mkpasswd -m sha-512 admin randomsalt
  </code></pre>
  
  <p>Why is this not working? Does symfony2 expect the hash to be in some other format?</p>
  
  <p>EDIT: things I've tried as well:</p>
  
  <ul>
  <li>generating the hash through PHP using <code>crypt($password, "$6$".$salt)</code></li>
  <li>toggling <code>encode_as_base64</code> true/false on the security encoder</li>
  <li>specifying the number of iterations to use (default 5000)</li>
  </ul>
  
  <p>Result is the same: "Bad credentials".</p>