O'Reilly logo

Learning Spring Boot by Greg L. Turnquist

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring user data to persist

So far, our configuration is quite extensive. We have created multiple accounts, with each user possessing different roles. However, this is an in-memory storage mechanism. To upgrade our app to support a complete production environment, we can borrow some of the concepts visited in Chapter 4, Data Access with Spring Boot. In that chapter we learned how to switch between an in-memory database and a persistent one using Spring Profiles. We'll do the same thing here and see what options Spring Security offers at the same time.

For starters, we need to add mysql-connector-java to build.gradle so that the dependencies section looks like the following code:

dependencies { compile("org.springframework.boot:spring-boot-starter-thymeleaf") ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required