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

Ria*_*adh 5 security authentication spring remember-me

在Spring Security中管理“记住我”身份验证的默认表名称为“ persistent_logins”。

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

请帮忙。

Nei*_*gan 5

您需要编写自己的JdbcTokenRepositoryImpl实现

创建一个扩展JdbcDaoSupport的类并实现PersistentTokenRepository

在Spring Application Context Config中将此类配置为Bean,然后将其设置为Remember-me Spring Security Config的token-repository-ref属性

但坦率地说,我将首先更改您的表命名策略。