Skip to content

Commit 2be3f52

Browse files
committed
minor symfony#3422 [Cookbook][Custom Authentication Provider] add a note of warning for when forbidding anonymous users (cordoval)
This PR was merged into the 2.3 branch. Discussion ---------- [Cookbook][Custom Authentication Provider] add a note of warning for when forbidding anonymous users | Q | A | | --- | --- | | Doc fix? | yes | | New docs? | no | | Applies to | 2.3+ | | Fixed tickets | symfony#3212 | | License | CC-ASA 3.0 Unported | Sent using [Gush](https://github.com/cordoval/gush) Commits ------- 244d756 add note when forbidding access to anonymous users on custom authentication provider
2 parents 13222c9 + 244d756 commit 2be3f52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cookbook/security/custom_authentication_provider.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ a 403 Response is returned.
182182
does not require maintaining authentication sessions or login forms, it
183183
won't be used for this example.
184184

185+
.. note::
186+
187+
Returning prematurely from the listener is relevant only if you want to chain
188+
authentication providers (for example to allow anonymous users). If you want
189+
to forbid access to anonymous users and have a nice 403 error, you should set
190+
the status code of the response before returning.
191+
185192
The Authentication Provider
186193
---------------------------
187194

0 commit comments

Comments
 (0)