# config/packages/security.yaml
security:
encoders:
App\Security\User: 'native'
# config/packages/security.yaml
security:
encoders:
App\Security\User: 'sodium'
# config/packages/security.yaml
security:
encoders:
App\Security\User: 'auto'
<?php
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
interface PasswordUpgraderInterface
{
/**
* Upgrades the encoded password of a user, typically for using a better hash algorithm.
*/
public function upgradePassword(UserInterface $user, string $newEncodedPassword): void;
}
<?php
use Symfony\Component\Security\Guard\AuthenticatorInterface;
use Symfony\Component\Security\Guard\PasswordAuthenticatedInterface;
class FormLoginAuthenticator implements PasswordAuthenticatedInterface
{
// ...
public function getPassword($credentials): ?string
{
return $credentials['password'];
}
}