如何在 Spring-Security 中重命名 table persistent_logins

How to rename the table persistent_logins in Spring-Security

在 Spring 安全性中管理记住我身份验证的默认 table 名称是 "persistent_logins"。

由于数据库命名约定,我需要将此 table“persistent_logins”重命名为“T_PERSISTENT_LOGINS” ”。

请帮忙。

您需要自己编写 JdbcTokenRepositoryImpl

的实现

创建一个 class 扩展 JdbcDaoSupport 并实现 PersistentTokenRepository

将此 class 配置为您的 Spring 应用程序上下文配置中的 bean,然后将其设置为 remember-me Spring 安全配置的 token-repository-ref 属性

但坦率地说,我会先更改您的 table 命名策略。