From d20da0243171a652739d34f20e908c6dbe37f384 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 4 Oct 2017 10:34:07 +0200 Subject: [PATCH 1/2] Deprecate auto picking the first provider --- security/multiple_user_providers.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/multiple_user_providers.rst b/security/multiple_user_providers.rst index 2382371bd34..5542cc03b3a 100644 --- a/security/multiple_user_providers.rst +++ b/security/multiple_user_providers.rst @@ -1,6 +1,11 @@ How to Use multiple User Providers ================================== +.. versionadded:: 3.4 + Using the first user provider when the firewall doesn't define a provider + has been deprecated in Symfony 3.4 and will throw an exception in 4.0. + Always define the provider used by the firewall when there are multiple providers. + Each authentication mechanism (e.g. HTTP Authentication, form login, etc) uses exactly one user provider, and will use the first declared user provider by default. But what if you want to specify a few users via configuration From 9f33e8df8651bfac7f0ca181bf53ef525deff412 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sun, 8 Oct 2017 22:13:56 +0200 Subject: [PATCH 2/2] More rewords --- security/multiple_user_providers.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/security/multiple_user_providers.rst b/security/multiple_user_providers.rst index 5542cc03b3a..dc26f528223 100644 --- a/security/multiple_user_providers.rst +++ b/security/multiple_user_providers.rst @@ -1,11 +1,6 @@ How to Use multiple User Providers ================================== -.. versionadded:: 3.4 - Using the first user provider when the firewall doesn't define a provider - has been deprecated in Symfony 3.4 and will throw an exception in 4.0. - Always define the provider used by the firewall when there are multiple providers. - Each authentication mechanism (e.g. HTTP Authentication, form login, etc) uses exactly one user provider, and will use the first declared user provider by default. But what if you want to specify a few users via configuration @@ -87,10 +82,16 @@ a new provider that chains the two together: ), )); -Now, all firewalls without an explicitly configured user provider will use -the ``chain_provider`` since it's the first specified. The ``chain_provider`` -will, in turn, try to load the user from both the ``in_memory`` and ``user_db`` -providers. +Now, all firewalls that explicitly define ``chain_provider`` as their user +provider will, in turn, try to load the user from both the ``in_memory`` and +``user_db`` providers. + +.. versionadded:: 3.4 + In previous Symfony versions, firewalls that didn't define their user provider + explicitly, used the first existing provider (``chain_provider`` in this + example). However, auto-selecting the first user provider has been deprecated + in Symfony 3.4 and will throw an exception in 4.0. Always define the provider + used by the firewall when there are multiple providers. You can also configure the firewall or individual authentication mechanisms to use a specific provider. Again, unless a provider is specified explicitly,