8000 feature #8612 Update the multiple user providers article (javiereguiluz) · Warxcell/symfony-docs@0b62cc0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b62cc0

Browse files
committed
feature symfony#8612 Update the multiple user providers article (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Update the multiple user providers article In Symfony 4.0 we can finally remove any reference to: *"if you don't define a provider, the first one will be used"*. Commits ------- 7fdde84 Update the multiple user providers article
2 parents ec2d05a + 7fdde84 commit 0b62cc0

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

security/multiple_user_providers.rst

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
How to Use multiple User Providers
22
==================================
33

4-
Each authentication mechanism (e.g. HTTP Authentication, form login, etc)
5-
uses exactly one user provider, and will use the first declared user provider
6-
by default. But what if you want to specify a few users via configuration
7-
and the rest of your users in the database? This is possible by creating
8-
a new provider that chains the two together:
4+
Each authentication mechanism (e.g. HTTP Authentication, form login, etc.) uses
5+
exactly one user provider. But what if you want to specify a few users via
6+
configuration and the rest of your users in the database? This is possible by
7+
creating a new provider that chains the two together:
98

109
.. configuration-block::
1110

@@ -82,20 +81,12 @@ a new provider that chains the two together:
8281
),
8382
));
8483
85-
Now, all firewalls that explicitly define ``chain_provider`` as their user
86-
provider will, in turn, try to load the user from both the ``in_memory`` and
87-
``user_db`` providers.
88-
89-
.. versionadded:: 3.4
90-
In previous Symfony versions, firewalls that didn't define their user provider
91-
explicitly, used the first existing provider (``chain_provider`` in this
92-
example). However, auto-selecting the first user provider has been deprecated
93-
in Symfony 3.4 and will throw an exception in 4.0. Always define the provider
94-
used by the firewall when there are multiple providers.
84+
Now, all firewalls that define ``chain_provider`` as their user provider will,
85+
in turn, try to load the user from both the ``in_memory`` and ``user_db``
86+
providers.
9587

9688
You can also configure the firewall or individual authentication mechanisms
97-
to use a specific provider. Again, unless a provider is specified explicitly,
98-
the first provider is always used:
89+
to use a specific provider:
9990

10091
.. configuration-block::
10192

@@ -151,10 +142,10 @@ the first provider is always used:
151142
),
152143
));
153144
154-
In this example, if a user tries to log in via HTTP authentication, the authentication
155-
system will use the ``in_memory`` user provider. But if the user tries to
156-
log in via the form login, the ``user_db`` provider will be used (since it's
157-
the default for the firewall as a whole).
145+
In this example, if a user tries to log in via HTTP authentication, the
146+
authentication system will use the ``in_memory`` user provider. But if the user
147+
tries to log in via the form login, the ``user_db`` provider will be used (since
148+
it's the default for the firewall as a whole).
158149

159150
For more information about user provider and firewall configuration, see
160151
the :doc:`/reference/configuration/security`.

0 commit comments

Comments
 (0)
0