Skip to content

[PasswordHasher] EncoderFactory broken if a custom hasher is configured #41024

@derrabus

Description

@derrabus

Symfony version(s) affected: 5.3.0-BETA2

Description
If an application configures a custom PasswordHasherInterface implementation, the old EncoderFactory and UserPasswordEncoder services become unusable.

How to reproduce
Reproducer: https://github.com/derrabus/encoder-factory-reproducer

Launch the application, enter some text into the input field and hit the submit button. The application will crash with an exception:

Symfony\Component\Security\Core\Encoder\EncoderFactory::createEncoder(): Argument #1 ($config) must be of type array, App\Security\MyHasher given, called in /path/to/vendor/symfony/security-core/Encoder/EncoderFactory.php on line 63

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions