如何在Spring-Security中重命名表persistent_logins [英] How to rename the table persistent_logins in Spring-Security
问题描述
在Spring Security中管理记住我"身份验证的默认表名称是"persistent_logins".
The default table name that manages remember-me authentication in Spring Security is "persistent_logins".
由于数据库命名约定,我需要将此表" persistent_logins "重命名为" T_PERSISTENT_LOGINS ".
Due to Database naming conventions, I need to rename this table "persistent_logins" to "T_PERSISTENT_LOGINS".
请帮忙.
推荐答案
您需要编写自己的创建一个扩展JdbcDaoSupport并实现PersistentTokenRepository的类
Create a class extending JdbcDaoSupport and implementing PersistentTokenRepository
在Spring Application Context Config中将该类配置为Bean,然后将其设置为记住我的Spring Security Config的token-repository-ref属性
Configure this class as a bean in your Spring Application Context Config, then set it as the token-repository-ref attribute of the remember-me Spring Security Config
但是坦率地说,我将首先更改您的表命名策略.
But frankly, I'd change your table naming policy first.
这篇关于如何在Spring-Security中重命名表persistent_logins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!