Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e1e69d9

Browse filesBrowse files
committed
clarify that user context url needs to be available to anonymous users
1 parent f12b74b commit e1e69d9
Copy full SHA for e1e69d9

File tree

Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed

‎Resources/doc/features/user-context.rst

Copy file name to clipboardExpand all lines: Resources/doc/features/user-context.rst
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You need to configure a route for the context hash. It does not specify any
4949
controller, as the request listener will abort the request right after the
5050
firewall has been applied, but the route definition must exist. Use the same
5151
path as you specified in the caching proxy and make sure that this path is
52-
covered by your
52+
allowed for anonymous users and covered by your
5353
`firewall configuration <http://symfony.com/doc/current/book/security.html>`_:
5454

5555
.. code-block:: yaml
@@ -58,6 +58,17 @@ covered by your
5858
user_context_hash:
5959
path: /_fos_user_context_hash
6060
61+
If your access rules limit the whole site to logged in users, make sure to
62+
handle the user context URL like the login page:
63+
64+
.. code-block:: yaml
65+
66+
# app/config/security.yml
67+
access_control:
68+
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
69+
- { path: ^/_fos_user_context_hash, roles: [IS_AUTHENTICATED_ANONYMOUSLY] }
70+
- { path: ^/, roles: ROLE_USER }
71+
6172
Finally, enable the subscriber with the default settings:
6273

6374
.. code-block:: yaml

‎Resources/doc/spelling_word_list.txt

Copy file name to clipboardExpand all lines: Resources/doc/spelling_word_list.txt
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ lookup
1414
lookups
1515
TTL
1616
multi
17+
login
1718
logout

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.