File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,50 @@ class that processes the login submit and 4) updates the main security config fi
74
74
}
75
75
}
76
76
77
+ Edit the security.yml file in order to allow access to the ``/login `` route:
78
+
79
+ .. configuration-block ::
80
+
81
+ .. code-block :: yaml
82
+
83
+ # config/packages/security.yaml
84
+ security :
85
+ # ...
86
+
87
+ access_control :
88
+ - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
89
+ # ...
90
+
91
+ .. code-block :: xml
92
+
93
+ <!-- config/packages/security.xml -->
94
+ <?xml version =" 1.0" charset =" UTF-8" ?>
95
+ <srv : container xmlns =" http://symfony.com/schema/dic/security"
96
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
97
+ xmlns : srv =" http://symfony.com/schema/dic/services"
98
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
99
+ http://symfony.com/schema/dic/services/services-1.0.xsd" >
100
+
101
+ <config >
102
+ <rule path =" ^/login" role =" IS_AUTHENTICATED_ANONYMOUSLY" />
103
+ <!-- ... -->
104
+ </config >
105
+ </srv : container >
106
+
107
+ .. code-block :: php
108
+
109
+ // config/packages/security.php
110
+ $container->loadFromExtension('security', [
111
+ // ...
112
+ 'access_control' => [
113
+ [
114
+ 'path' => '^/login',
115
+ 'roles' => 'IS_AUTHENTICATED_ANONYMOUSLY',
116
+ ],
117
+ // ...
118
+ ],
119
+ ]);
120
+
77
121
**Step 2. ** The template has very little to do with security: it just generates
78
122
a traditional HTML form that submits to ``/login ``:
79
123
You can’t perform that action at this time.
0 commit comments