Skip to content

Commit 244d756

Browse files
committed
add note when forbidding access to anonymous users on custom authentication provider
1 parent 0428c57 commit 244d756

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cookbook/security/custom_authentication_provider.rst

+7
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)