spring-security - 使用 Spring Security 进行验证
问题描述
不幸的是,我没有让 Recaptcha 为我的应用程序工作localhost
。我跟着Baeldung的介绍。localhost
我为and创建了一个网站密钥和秘密127.0.0.1
。
在我的 html 头中有脚本 src:
`<script src="https://www.google.com/recaptcha/api.js"></script>`
recaptcha 的 div 看起来像:
`<div class="g-recaptcha" data-sitekey="6Le_LZgUAAAAAKlzsoEBOOQvCOqIr7r65eiN4bd4">recaptcha</div>`
`<span id="captchaError" class="alert alert-danger " style="display:none"></span>`
但我总是在无效的网站密钥时收到错误消息:
我能做些什么?感谢您的提示。
解决方案
我遇到的另一个解决方案是使用recaptcha-spring-boot-starter
. 它大大减少了我的代码,但我只使用 Recaptcha V2 运行它。但这对我来说也没关系:
https://github.com/mkopylec/recaptcha-spring-boot-starter-samples
推荐阅读
- php - 无法更新数据库中的数据
- python - 气流 execution_date 错误值
- sql-server - 使用名为“发送”的 BIT 字段更改 MS-SQL-Management Studio (SSMS) 中的数据失败
- python - 以编程方式检查并禁用 IPython 自动重载扩展
- parsing - 在不依赖词法分析器规范的情况下生成一个解析器生成器的小型工作示例?
- css - 是否可以使用多个选择器 CSS 为多个类描述相同的样式
- azure - Azure API 管理负载大小
- android - 如何使 setBackgroundResource 使用 SharedPreferences 保存图像
- javascript - 对于这个数据结构/算法问题,我应该如何改变我的方法?
- java - 如何通过运行 spring boot 测试代码来解决这个问题?