java - 托管到服务器时,登录在 Spring Boot(使用 Spring Security)中不起作用

标签 java spring-boot spring-security digital-ocean

我使用Spring securityH2数据库创建了一个Spring Boot应用程序。该应用程序在 LocalHeroku 中运行良好。但是,无法在 Digital Ocean 的 Ubuntu Droplet 中工作。当我访问服务器时,它会显示登录页面。但是当我使用凭据(保存在 h2 数据库中)登录时,它会永远加载页面并且没有任何响应。我可以访问其他不安全的网址。我使用 j_spring_security_check 进行身份验证。

我检查过的事情:

  • 在编译时添加 H2 依赖项(已删除 运行时)。
  • schema.sql 和 data.sql 正在执行(可以在启动中看到 日志)

最佳答案

以下解决了该问题:

https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged .

它由于服务器中的熵较少而挂起,并且可能在任何时候挂起,特别是当加密逻辑正在运行时。

  • Web Server
  • Incoming/Outgoing Mail Server
  • SSH/SFTP

Should any of these daemons require randomness when all available entropy has been exhausted, they may pause to wait for more, which can cause excessive delays in your application. Even worse, since most modern applications will either resort to using its own random seed created at program initialization, or to using /dev/urandom to avoid blocking, your applications will suffer from lower quality random data.

关于java - 托管到服务器时,登录在 Spring Boot(使用 Spring Security)中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57200377/

相关文章:

java - 降低音乐质量(320 kbps 至 64 kbps)

java - 如何在 Java Spring Boot 中获取 zip 文件作为响应?

Spring Framework、Spring Security - 可以在没有 Spring Framework 的情况下使用 Spring Security 吗?

java - 如何在 Spring Boot 安全性上将用户名传递到 application.properties 的登录 SQL 代码中?

java - 在java中扫描图像以获得特定像素颜色

java - 字符串索引超出范围 : 2 No idea why this is appearing

java - 未从 AttributeConverter 内的属性获取值

spring-boot无法加载JDBC驱动程序类 "org.sqlite.JDBC"

mysql - 如何在 Spring Security 登录表单中传递一个附加参数

java - TestNG Reporting,如何快速识别Retry-d Tests?