Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename the table persistent_logins in Spring-Security

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.

like image 486
Riadh Avatar asked Mar 28 '16 11:03

Riadh


1 Answers

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.

like image 53
Neil McGuigan Avatar answered Nov 13 '22 04:11

Neil McGuigan