Skip to content

Commit 132fefa

Browse files
Jeroen SeegersJeroen Seegers
Jeroen Seegers
authored and
Jeroen Seegers
committed
Add tip when returning null from createToken()
1 parent 340ec5f commit 132fefa

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

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

0 commit comments

Comments
 (0)