Skip to content

Commit 636518b

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: [SecurityBundle] Add doc for stateless firewall
2 parents 2582a1e + 732ae9e commit 636518b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

reference/configuration/security.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,55 @@ multiple firewalls, the "context" could actually be shared:
888888
ignored and you won't be able to authenticate on multiple firewalls at the
889889
same time.
890890

891+
stateless
892+
~~~~~~~~~
893+
894+
Firewalls can configure a ``stateless`` boolean option in order to declare that
895+
the session must not be used when authenticating users:
896+
897+
.. configuration-block::
898+
899+
.. code-block:: yaml
900+
901+
# config/packages/security.yaml
902+
security:
903+
# ...
904+
905+
firewalls:
906+
main:
907+
# ...
908+
stateless: true
909+
910+
.. code-block:: xml
911+
912+
<!-- config/packages/security.xml -->
913+
<?xml version="1.0" encoding="UTF-8" ?>
914+
<srv:container xmlns="http://symfony.com/schema/dic/security"
915+
xmlns:srv="http://symfony.com/schema/dic/services"
916+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
917+
xsi:schemaLocation="http://symfony.com/schema/dic/services
918+
https://symfony.com/schema/dic/services/services-1.0.xsd
919+
http://symfony.com/schema/dic/security
920+
https://symfony.com/schema/dic/security/security-1.0.xsd">
921+
922+
<config>
923+
<firewall name="main" stateless="true">
924+
<!-- ... -->
925+
</firewall>
926+
</config>
927+
</srv:container>
928+
929+
.. code-block:: php
930+
931+
// config/packages/security.php
932+
use Symfony\Config\SecurityConfig;
933+
934+
return static function (SecurityConfig $security) {
935+
$mainFirewall = $security->firewall('main');
936+
$mainFirewall->stateless(true);
937+
// ...
938+
};
939+
891940
User Checkers
892941
~~~~~~~~~~~~~
893942

0 commit comments

Comments
 (0)