You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cookbook/security/api_key_authentication.rst
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -210,6 +210,27 @@ exception in ``refreshUser()``.
210
210
If you *do* want to store authentication data in the session so that
211
211
the key doesn't need to be sent on every request, see :ref:`cookbook-security-api-key-session`.
212
212
213
+
Handling Exceptions
214
+
-------------------
215
+
216
+
In order for you're ``ApiKeyAuthentication`` to correctly display a 403 http status when either bad credentials, or authentication fails you will need to implement the ``AuthenticationFailureHandlerInterface`` on your Authenticator. This will provide a method ``onAuthenticationFailure`` which you can then return a ``Response`` with.
0 commit comments