将Captcha与Spring Security集成 [英] Integrating Captcha with Spring Security

查看:214
本文介绍了将Captcha与Spring Security集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将SpringSecurity与Capcha集成的合适方法是什么?

What is appropriate way to integrate SpringSecurity with Capcha ?

我有以下用例:
当用户尝试登录时,如果我们登录N次失败,将显示验证码,因此将进行身份验证使用三个参数:用户名,密码,验证码。但是Spring Security不支持内置的Captcha处理。

I have following use case : When user will tries to login, if we he failed to login N times, captcha will be displayed, so authentication will be using three parameters : username, password, captcha. But Spring Security doesn't support built in Captcha handling.

我刚刚开始考虑实施。并具有以下变体:

I just start thinking about implementation. And have following variants:


  • 在Spring Security过滤器堆栈中添加单独的安全过滤器,

  • 完全重写AuthenticationProcessingFilter以支持某些验证码

  • 使用具有拦截验证码逻辑的程序验证,然后将用户名和密码传输到Spring Security

作为Captcha的实现,我想到了JCaptcha,但是您有什么想法?

As a Captcha implementation I think about JCaptcha, but what your thougths?

推荐答案

看看这个文章:春季安全性3:集成reCAPTCHA服务

这使用两个过滤器使reCAPTCHA集成尽可能无缝和不干扰。这意味着您现有的Spring Security实现不会中断。无需接触现有课程

This uses two filters to make reCAPTCHA integration as seamless and unobstrusive as possible. That means your existing Spring Security implementation will not break. No need to touch existing classes

这篇关于将Captcha与Spring Security集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆