Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Security] Explain lazy anonymous mode#13171
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletionshttp_cache.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| .. index:: | ||
| single: Cache | ||
| .. _http-cache: | ||
| HTTP Cache | ||
| ========== | ||
32 changes: 24 additions & 8 deletionssecurity.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -281,7 +281,7 @@ important section is ``firewalls``: | ||
| .. versionadded:: 4.4 | ||
| The ``lazy``anonymous mode has been introduced in Symfony 4.4. | ||
| A "firewall" is your authentication system: the configuration below it defines | ||
| *how* your users will be able to authenticate (e.g. login form, API token, etc). | ||
| @@ -293,18 +293,34 @@ accidentally block Symfony's dev tools - which live under URLs like ``/_profiler | ||
| and ``/_wdt``. | ||
| All *real* URLs are handled by the ``main`` firewall (no ``pattern`` key means | ||
| it matches *all* URLs). | ||
| A firewall can have many modes of authentication, in other words many ways to | ||
| ask the question "Who are you?". | ||
| It is convenient to first let users answer "I'm no one in particular, just a | ||
| visitor as any other", this mode is ``anonymous``. | ||
| In fact, if you go to the homepage right now, you *will* have access and you'll | ||
| see that you're "authenticated" as ``anon.``. The firewall verified that it | ||
| does not know your identity, and so, you are anonymous: | ||
| .. image:: /_images/security/anonymous_wdt.png | ||
| :align: center | ||
| It means any request can have an anonymous token to access some resource, while | ||
| some actions (i.e. some pages or buttons) can still require some privileges. | ||
| A request can then access a form login without being authenticated as a unique | ||
| user (otherwise an infinite redirection loop would happen asking the user to | ||
| authenticate while trying to doing so). | ||
wouterj marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| You'll learn later how to deny access to certain URLs, controllers, or part of | ||
| templates. | ||
| .. note:: | ||
| The ``lazy`` anonymous mode prevent the session from being started if there | ||
| is no need for authorization (i.e. explicit check for a user privilege). | ||
| This is important to keep requests cacheable (see | ||
| :ref:`HTTP cache <http-cache>`). | ||
| .. note:: | ||
4 changes: 2 additions & 2 deletionssecurity/form_login.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.