Skip to content

Commit 06c0809

Browse files
Adding info about when the firewall needs to encompass all pages
1 parent dfc2982 commit 06c0809

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

security.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,13 @@ will be able to authenticate (e.g. login form, API token, etc).
588588
Only one firewall is active on each request: Symfony uses the ``pattern`` key
589589
to find the first match (you can also
590590
:doc:`match by host or other things </security/firewall_restriction>`).
591+
Here, all "real" URLs are handled by the ``main`` firewall (no ``pattern`` key means
592+
it matches *all* URLs).
591593

592594
The ``dev`` firewall is really a fake firewall: it makes sure that you
593595
don't accidentally block Symfony's dev tools - which live under URLs like
594596
``/_profiler`` and ``/_wdt``.
595597

596-
All *real* URLs are handled by the ``main`` firewall (no ``pattern`` key means
597-
it matches *all* URLs). A firewall can have many modes of authentication,
598-
in other words, it enables many ways to ask the question "Who are you?".
599-
600598
Often, the user is unknown (i.e. not logged in) when they first visit your
601599
website. If you visit your homepage right now, you *will* have access and
602600
you'll see that you're visiting a page behind the firewall in the toolbar:
@@ -606,7 +604,14 @@ you'll see that you're visiting a page behind the firewall in the toolbar:
606604

607605
Visiting a URL under a firewall doesn't necessarily require you to be authenticated
608606
(e.g. the login form has to be accessible or some parts of your application
609-
are public). You'll learn how to restrict access to URLs, controllers or
607+
are public). On the other hand, all pages that you want to be *aware* of a logged in
608+
user have to be under the same firewall. So if you want to display a "You are logged in
609+
as ..." message on every page, they all have to be included in the same firewall.
610+
611+
The same firewall can have many modes of authentication,
612+
in other words, it enables many ways to ask the question "Who are you?".
613+
614+
You'll learn how to restrict access to URLs, controllers or
610615
anything else within your firewall in the :ref:`access control
611616
<security-access-control>` section.
612617

0 commit comments

Comments
 (0)