Skip to content

Commit 3bfea4d

Browse files
Jeroen SeegersJeroen Seegers
Jeroen Seegers
authored and
Jeroen Seegers
committed
Add tip when returning null from createToken()
1 parent bb1c807 commit 3bfea4d

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
@@ -130,6 +130,11 @@ will cause authentication to fail. You might want to return ``null`` instead
130130
to just skip the authentication, so Symfony can fallback to another authentication
131131
method, if any.
132132

133+
.. tip::
134+
135+
In case you return ``null`` from your ``createToken()`` method, be sure to enable
136+
``anonymous`` in you firewall. This way you'll be able to get an ``AnonymousToken``.
137+
133138
2. supportsToken
134139
~~~~~~~~~~~~~~~~
135140

0 commit comments

Comments
 (0)