Skip to content

Commit 983029a

Browse files
committed
Document AUTHENTICATION_SUCCESS_SENSITIVE event
1 parent 5d19ec3 commit 983029a

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

components/security/authentication.rst

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,17 @@ in) is correct, you can use::
274274
Authentication Events
275275
---------------------
276276

277-
The security component provides 4 related authentication events:
278-
279-
=============================== ================================================ ==============================================================================
280-
Name Event Constant Argument Passed to the Listener
281-
=============================== ================================================ ==============================================================================
282-
security.authentication.success ``AuthenticationEvents::AUTHENTICATION_SUCCESS`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationEvent`
283-
security.authentication.failure ``AuthenticationEvents::AUTHENTICATION_FAILURE`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationFailureEvent`
284-
security.interactive_login ``SecurityEvents::INTERACTIVE_LOGIN`` :class:`Symfony\\Component\\Security\\Http\\Event\\InteractiveLoginEvent`
285-
security.switch_user ``SecurityEvents::SWITCH_USER`` :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent`
286-
=============================== ================================================ ==============================================================================
277+
The security component provides 5 related authentication events:
278+
279+
========================================= ========================================================== ==============================================================================
280+
Name Event Constant Argument Passed to the Listener
281+
========================================= ========================================================== ==============================================================================
282+
security.authentication.success_sensitive ``AuthenticationEvents::AUTHENTICATION_SUCCESS_SENSITIVE`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationSensitiveEvent`
283+
security.authentication.success ``AuthenticationEvents::AUTHENTICATION_SUCCESS`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationSuccessEvent`
284+
security.authentication.failure ``AuthenticationEvents::AUTHENTICATION_FAILURE`` :class:`Symfony\\Component\\Security\\Core\\Event\\AuthenticationFailureEvent`
285+
security.interactive_login ``SecurityEvents::INTERACTIVE_LOGIN`` :class:`Symfony\\Component\\Security\\Http\\Event\\InteractiveLoginEvent`
286+
security.switch_user ``SecurityEvents::SWITCH_USER`` :class:`Symfony\\Component\\Security\\Http\\Event\\SwitchUserEvent`
287+
========================================= ========================================================== ==============================================================================
287288

288289
Authentication Success and Failure Events
289290
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -298,6 +299,18 @@ a ``security.authentication.failure`` event is dispatched. You could listen on
298299
the ``security.authentication.failure`` event, for example, in order to log
299300
failed login attempts.
300301

302+
Authentication Sensitive Event
303+
------------------------------
304+
305+
When a user is successfully authenticated, the security component will also
306+
dispatch a ``security.authentication.success_sensitive`` just before erasing
307+
credentials and dispatching the regular success event. The event object will
308+
contain the token used to authenticate, allowing you to act upon its sensitive
309+
information.
310+
311+
A common use for this would be to check whether a user's password needs
312+
rehashing to stay up to date with current encryption standards.
313+
301314
Security Events
302315
~~~~~~~~~~~~~~~
303316

0 commit comments

Comments
 (0)