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") compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-security") compile("org.thymeleaf.extras:thymeleaf-extras-springsecurity3") compile("org.springframework...