Skip to content

Commit 1337b31

Browse files
Jeroen Seegersxabbuh
Jeroen Seegers
authored andcommitted
Add caution when returning null from createToken()
1 parent 4ee6cb2 commit 1337b31

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cookbook/security/api_key_authentication.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ will cause authentication to fail. You might want to return ``null`` instead
109109
to just skip the authentication, so Symfony can fallback to another authentication
110110
method, if any.
111111

112+
.. caution::
113+
114+
In case you return ``null`` from your ``createToken()`` method, be sure to enable
115+
``anonymous`` in you firewall. This way you'll be able to get an ``AnonymousToken``.
116+
112117
2. supportsToken
113118
~~~~~~~~~~~~~~~~
114119

0 commit comments

Comments
 (0)