Skip to content

Commit

Permalink
Set auto password hasher for all user classes (see #6289)
Browse files Browse the repository at this point in the history
Description
-----------

In Symfony 5.3 this config was added to the default security config in order to enable the `auto` password hasher for all user classes that implement this interface (see symfony/recipes#981) - which `Contao\User` also implements.

I think we should do the same in the `contao/managed-edition`. This way you don't have to define this yourself in case you are using HTTP Basic Authentication for some controller outside Contao's own firewalls. For instance, in [this example](#6220 (comment)) the line

```php
$extensionConfig['password_hashers'][InMemoryUser::class] = 'auto';
```

could be omitted then.

Commits
-------

84c6d47 set auto password hasher to auto for all
ab0a671 also set password hasher for Contao\User specifically
593d244 update README and test config
  • Loading branch information
fritzmg committed Aug 24, 2023
1 parent 9c14a1b commit a233e18
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core-bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ sections:
security:
password_hashers:
Contao\User: auto
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: auto

providers:
contao.security.backend_user_provider:
Expand Down
1 change: 1 addition & 0 deletions core-bundle/tests/Functional/app/config/security.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
security:
password_hashers:
Contao\User: auto
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: auto

providers:
contao.security.backend_user_provider:
Expand Down
1 change: 1 addition & 0 deletions manager-bundle/skeleton/config/security.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
security:
password_hashers:
Contao\User: auto
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: auto

providers:
contao.security.backend_user_provider:
Expand Down

0 comments on commit a233e18

Please sign in to comment.