在Symfony 4和FOSRestBundle下限制登录尝试

问题描述 投票:-2回答:1

我使用FOSRestBundle中的Symfony 4,并希望以此来保护我的登录表单。

我想在登录表单上设置有限的连接尝试次数(最多5分钟,共15分钟,然后30分钟,然后1小时)

我已搜索并且找到了此链接

https://blog.netinfluence.ch/2019/04/18/limiter-le-nombre-de-tentatives-de-connexions-sous-symfony/

但是在此链接中,只有在使用symfony Guard来实现登录系统时才实现。谢谢您的帮助!

php symfony symfony4 fosrestbundle login-attempts
1个回答
0
投票

使用ip创建新实体,failedCount和lastModified(作为时间)。每当有人输入错误的凭据时,将其插入或更新为具有增加的failCount的新表。添加逻辑取决于ip,failedCount和lastModified。

OR

使用Google验证码:P

© www.soinside.com 2019 - 2024. All rights reserved.