Spring Applications
Project: Catalog Service Security
The objective of this exercise is to secure the catalog service of the bookstore application using basic authentication.
-
Add the starter
spring-boot-starter-security
as Maven dependency.
-
Implement a security configuration class with three bean methods that create
- a password encoder that uses the bcrypt hashing function
- an in-memory user details service with a fixed user with the role
EMPLOYEE
- a security filter chain such that basic authentication is used and adding and updating books is restricted to users with the
EMPLOYEE
role
-
Test the security constraints using the Postman utility.