symfony-docs
symfony-docs copied to clipboard
[SecurityBundle] Deprecate not configuring explicitly a provider for cu…
| Q | A |
|---|---|
| Feature PR | symfony/symfony#43835 |
| PR author(s) | @lyrixx |
| Merged in | 5.4 |
We have some custom_authenticators occurrences in docs ... but I'm not sure if we have to change something. I don't fully understand the changes at https://github.com/symfony/symfony/pull/43835
@javiereguiluz There is a new deprecation when one have two or more user provider and a custom_authenticator and does not specify the user provider to use.
the following configuration will emit a deprecation:
security:
enable_authenticator_manager: true
providers:
app_user_provider_email:
entity:
class: App\Entity\User
property: email
app_user_provider_token:
entity:
class: App\Entity\User
property: token
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
custom_authenticator: App\Security\TokenAuthenticator
and the following one is OK:
security:
enable_authenticator_manager: true
providers:
app_user_provider_email:
entity:
class: App\Entity\User
property: email
app_user_provider_token:
entity:
class: App\Entity\User
property: token
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: app_user_provider_token
custom_authenticator: App\Security\TokenAuthenticator