Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 286f00c

Browse filesBrowse files
author
Kevin Weber
committed
Added security event descriptions to security component authentication page.
1 parent 12ed2e6 commit 286f00c
Copy full SHA for 286f00c

File tree

Expand file treeCollapse file tree

1 file changed

+48
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+48
-0
lines changed

‎components/security/authentication.rst

Copy file name to clipboardExpand all lines: components/security/authentication.rst
+48Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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\Component\Security\Core\Event\AuthenticationEvent`
279+
security.authentication.failure ``AuthenticationEvents::AUTHENTICATION_FAILURE`` :class:`Symfony\Component\Security\Core\Event\AuthenticationFailureEvent`
280+
security.interactive_login ``SecurityEvents::INTERACTIVE_LOGIN`` :class:`Symfony\Component\Security\Http\Event\InteractiveLoginEvent`
281+
security.switch_user ``SecurityEvents::SWITCH_USER`` :class:`Symfony\Component\Security\Http\Event\SwitchUserEvent`
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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.