@@ -267,5 +267,53 @@ in) is correct, you can use::
267267 $user->getSalt()
268268 );
269269
270+ Events
271+ ------
272+
273+ The security component provides 4 related events:
274+
275+ =============================== ================================================ =========================================================================
276+ Name Event Constant Argument Passed to the Listener
277+ =============================== ================================================ =========================================================================
278+ security.authentication.success ``AuthenticationEvents::AUTHENTICATION_SUCCESS `` :class: `Symfony\C omponent\S ecurity\C ore\E vent\A uthenticationEvent `
279+ security.authentication.failure ``AuthenticationEvents::AUTHENTICATION_FAILURE `` :class: `Symfony\C omponent\S ecurity\C ore\E vent\A uthenticationFailureEvent `
280+ security.interactive_login ``SecurityEvents::INTERACTIVE_LOGIN `` :class: `Symfony\C omponent\S ecurity\H ttp\E vent\I nteractiveLoginEvent `
281+ security.switch_user ``SecurityEvents::SWITCH_USER `` :class: `Symfony\C omponent\S ecurity\H ttp\E vent\S witchUserEvent `
282+ =============================== ================================================ =========================================================================
283+
284+ Authentication Events
285+ ~~~~~~~~~~~~~~~~~~~~~
286+
287+ When a provider authenticates the user, a ``security.authentication.success ``
288+ event is dispatched. Likewise, when no providers authenticate the user,
289+ a ``security.authentication.failure `` event is dispatched. You
290+ could listen on the ``security.authentication.failure `` event, for example,
291+ in order to log failed login attempts.
292+
293+ It is important to remember that one authentication event is always triggered
294+ when a request points to a secured area.
295+
296+ Security Events
297+ ~~~~~~~~~~~~~~~
298+
299+ The ``security.interactive_login `` event is triggered after a user has actively
300+ logged into your website. It is important to distinguish this action from
301+ non-interactive authentication methods, such as:
302+
303+ * authentication based on a "remember me" cookie.
304+ * authentication based on your session.
305+ * authentication using a HTTP basic or HTTP digest header.
306+
307+ You could listen on the ``security.interactive_login `` event, for example, in
308+ order to give your user a welcome flash message every time they log in.
309+
310+ The ``security.switch_user `` event is triggered every time you activate
311+ the ``switch_user `` firewall listener.
312+
313+ .. seealso ::
314+
315+ For more information on switching users, see
316+ :doc: `/cookbook/security/impersonating_user `.
317+
270318.. _`CVE-2013-5750` : http://symfony.com/blog/cve-2013-5750-security-issue-in-fosuserbundle-login-form
271319.. _`BasePasswordEncoder::checkPasswordLength` : https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php
0 commit comments