Authentication with Spring Data
In the previous chapter, we covered how to leverage Spring Security’s built-in Java DataBase Connectivity (JDBC) support. In this chapter, we will look at the Spring Data project and how to leverage Jakarta Persistence API (JPA) to perform authentication against a relational database. We will also explore how to perform authentication against a document database using MongoDB. This chapter’s sample code is based on the Spring Security setup from Chapter 4, JDBC-based Authentication, and it has been updated to refactor the need for SQL and to use ORM for all database interactions.
During the course of this chapter, we will cover the following topics:
- Some of the basic concepts related to the Spring Data project
- Utilizing Spring Data JPA to authenticate against a relational database
- Utilizing Spring Data MongoDB to authenticate against a document database
- How to customize Spring Security for more flexibility when dealing...