Skip to content

clarify that user context url needs to be available to anonymous users #294

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

Merged
merged 1 commit into from
Jul 1, 2016
Merged
Show file tree
Hide file tree
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
13 changes: 12 additions & 1 deletion Resources/doc/features/user-context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You need to configure a route for the context hash. It does not specify any
controller, as the request listener will abort the request right after the
firewall has been applied, but the route definition must exist. Use the same
path as you specified in the caching proxy and make sure that this path is
covered by your
allowed for anonymous users and covered by your
`firewall configuration <http://symfony.com/doc/current/book/security.html>`_:

.. code-block:: yaml
Expand All @@ -58,6 +58,17 @@ covered by your
user_context_hash:
path: /_fos_user_context_hash

If your access rules limit the whole site to logged in users, make sure to
handle the user context URL like the login page:

.. code-block:: yaml

# app/config/security.yml
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/_fos_user_context_hash, roles: [IS_AUTHENTICATED_ANONYMOUSLY] }
- { path: ^/, roles: ROLE_USER }

Finally, enable the subscriber with the default settings:

.. code-block:: yaml
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/spelling_word_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ lookup
lookups
TTL
multi
login
logout