JPA-based PersistentTokenRepository

As we have seen in the earlier chapters, using a Spring Data project for our database mapping can greatly simplify our work. So, to keep things consistent, we are going to refactor our JDBC-based PersistentTokenRepository interface that uses JdbcTokenRepositoryImpl to one that is JPA-based. We will do so by performing the following steps:

  1. First, let's create a domain object to hold the persistent logins, as shown in the following code snippet:
        //src/main/java/com/packtpub/springsecurity/domain/        PersistentLogin.java         import org.springframework.security.web.authentication.rememberme.        PersistentRememberMeToken;        import javax.persistence.*;        import java.io.Serializable;        import java.util.Date;        @Entity @Table(name ...

Get Spring Security - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.