He agregado limitación de inicio de sesión a mi aplicación Symfony. Si trato de iniciar sesión 5 veces seguidas en el mismo minuto con credenciales no válidas, tengo una TooManyLoginAttemptsAuthenticationException en el método onAuthenticationFailure de mi autenticador, hasta ahora todo bien.
Pero si trato de iniciar sesión con las credenciales correctas en el mismo minuto después de la TooManyLoginAttemptsAuthenticationException , esperaba tener el mismo error, pero en realidad inicié sesión correctamente.
Me estoy perdiendo de algo ?
Mi seguridad.yaml:
security: enable_authenticator_manager: true # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers providers: ldap: id: App\Security\LdapUserProvider # used to reload user from session & other features (eg switch_user) app_user_provider: entity: class: App\Entity\Utilisateur property: nni encoders: App\Entity\Utilisateur: algorithm: 'auto' role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: ROLE_ADMIN access_control: - { path: ^/get_team_email$, roles: PUBLIC_ACCESS } - { path: ^/login$, roles: PUBLIC_ACCESS } - { path: ^/login_check$, roles: PUBLIC_ACCESS } - { path: ^, roles: ROLE_USER} firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: pattern: ^/ security: true provider: '%connexion_provider%' entry_point: App\Security\LdapFormAuthenticator logout: path: /logout success_handler: app.logout.success.handler # configuring the maximum login attempts (per minute) login_throttling: max_attempts: 3 # activate different ways to authenticate # https://symfony.com/doc/current/security.html#firewalls-authentication # https://symfony.com/doc/current/security/impersonating_user.html # switch_user: true guard: authenticators: - App\Security\LdapFormAuthenticator form_login: use_forward: true login_path: login check_path: loginComo puede ver en el código fuente del controlador de aceleración , el limitador se restablece en los inicios de sesión exitosos. Solo se activa en tres intentos de inicio de sesión fallidos (donde esos 3 se han definido en su propia configuración)