Skip to content
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

[Security] Fix more heading levels in the security reference #20729

Merged
merged 1 commit into from
Mar 6, 2025
Merged
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
85 changes: 7 additions & 78 deletions reference/configuration/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,94 +38,23 @@ separate articles:
* `role_hierarchy`_

access_denied_url
~~~~~~~~~~~~~~~~~
-----------------

**type**: ``string`` **default**: ``null``

Defines the URL where the user is redirected after a ``403`` HTTP error (unless
you define a custom access denial handler). Example: ``/no-permission``

delete_cookies
~~~~~~~~~~~~~~

**type**: ``array`` **default**: ``[]``

Lists the names (and other optional features) of the cookies to delete when the
user logs out::

.. configuration-block::

.. code-block:: yaml

# config/packages/security.yaml
security:
# ...

firewalls:
main:
# ...
logout:
delete_cookies:
cookie1-name: null
cookie2-name:
path: '/'
cookie3-name:
path: null
domain: example.com

.. code-block:: xml

<!-- config/packages/security.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<srv:container xmlns="http://symfony.com/schema/dic/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:srv="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd">

<config>
<!-- ... -->

<firewall name="main">
<!-- ... -->
<logout path="...">
<delete-cookie name="cookie1-name"/>
<delete-cookie name="cookie2-name" path="/"/>
<delete-cookie name="cookie3-name" domain="example.com"/>
</logout>
</firewall>
</config>
</srv:container>

.. code-block:: php

// config/packages/security.php

// ...

return static function (SecurityConfig $securityConfig): void {
// ...

$securityConfig->firewall('main')
->logout()
->deleteCookie('cookie1-name')
->deleteCookie('cookie2-name')
->path('/')
->deleteCookie('cookie3-name')
->path(null)
->domain('example.com');
};

erase_credentials
~~~~~~~~~~~~~~~~~
-----------------

**type**: ``boolean`` **default**: ``true``

If ``true``, the ``eraseCredentials()`` method of the user object is called
after authentication.

hide_user_not_found
~~~~~~~~~~~~~~~~~~~
-------------------

**type**: ``boolean`` **default**: ``true``

Expand All @@ -138,7 +67,7 @@ If ``false``, the exception thrown is of type
and it includes the given not found user identifier.

session_fixation_strategy
~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------

**type**: ``string`` **default**: ``SessionAuthenticationStrategy::MIGRATE``

Expand All @@ -157,7 +86,7 @@ The possible values of this option are:
other session attributes are lost.

access_control
~~~~~~~~~~~~~~
--------------

Defines the security protection of the URLs of your application. It's used for
example to trigger the user authentication when trying to access to the backend
Expand All @@ -166,7 +95,7 @@ and to allow unauthenticated users to the login form page.
This option is explained in detail in :doc:`/security/access_control`.

firewalls
~~~~~~~~~
---------

This is arguably the most important option of the security config file. It
defines the authentication mechanism used for each URL (or URL pattern) of your
Expand Down Expand Up @@ -427,7 +356,7 @@ delete_cookies
**type**: ``array`` **default**: ``[]``

Lists the names (and other optional features) of the cookies to delete when the
user logs out::
user logs out:

.. configuration-block::

Expand Down