Skip to content

adding note that CSRF protection has to be enabled in config #8003

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

Closed
wants to merge 2 commits into from
Closed
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
15 changes: 12 additions & 3 deletions security/csrf_in_login_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ for CSRF. In this article you'll learn how you can use it in your login form.
Configuring CSRF Protection
---------------------------

First, configure the Security component so it can use CSRF protection.
The Security component needs a CSRF token provider. You can set this to use the default
provider available in the Security component:
First, make sure that the CSRF protection is enabled in the main cofiguration
file:

.. code-block:: yaml

# app/config/config.yml
framework:
# ...
csrf_protection: ~

Then, the security component needs a CSRF token provider. You can set this to
use the default provider available in the security component:

.. configuration-block::

Expand Down