How to rename the table persistent_logins in Spring-Security

纵然是瞬间 提交于 2020-12-05 11:39:08

问题


The default table name that manages remember-me authentication in Spring Security is "persistent_logins".

Due to Database naming conventions, I need to rename this table "persistent_logins" to "T_PERSISTENT_LOGINS".

Any help please.


回答1:


You'll need to write your own implementation of JdbcTokenRepositoryImpl

Create a class extending JdbcDaoSupport and implementing PersistentTokenRepository

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.



来源:https://stackoverflow.com/questions/36261216/how-to-rename-the-table-persistent-logins-in-spring-security

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!