Skip to content

Deprecate auto picking the first provider #8475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions security/multiple_user_providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,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,
Expand Down