Skip to content

Adding info about login throttling #17173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rate_limiter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defensive measure to protect services from excessive use (intended or not) and
maintain their availability. It's also useful to control your internal or
outbound processes (e.g. limit the number of simultaneously processed messages).

Symfony uses these rate limiters in built-in features like "login throttling",
Symfony uses these rate limiters in built-in features like :ref:`login throttling <security-login-throttling>`,
which limits how many failed login attempts a user can make in a given period of
time, but you can use them for your own features too.

Expand Down
2 changes: 2 additions & 0 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,8 @@ Enable remote user authentication using the ``remote_user`` key:
:ref:`the configuration reference <reference-security-firewall-remote-user>`
for more details.

.. _security-login-throttling:

Limiting Login Attempts
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
5 changes: 5 additions & 0 deletions security/custom_authenticator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ can define what happens in these cases:
useful for e.g. login forms, where the login controller is run again
with the login errors.

If you're using :ref:`login throttling <security-login-throttling>`,
you can check if ``$exception`` is an instance of
:class:`Symfony\\Component\\Security\\Core\\Exception\\TooManyLoginAttemptsAuthenticationException`
(e.g. to display an appropriate message).

**Caution**: Never use ``$exception->getMessage()`` for ``AuthenticationException``
instances. This message might contain sensitive information that you
don't want to be publicly exposed. Instead, use ``$exception->getMessageKey()``
Expand Down