Challenge: Spring Aspect Orientated Programming (AOP)
Explore how to implement authorization and authentication checks in a Spring Boot application using Spring's Aspect Oriented Programming. This lesson helps you create secure, maintainable code by defining aspects that intercept sensitive operations in the data layer and update methods. You will apply annotations and configure join points to ensure only authorized and authenticated users can perform actions like updating ebook titles, enhancing application security.
We'll cover the following...
Problem statement
Assume you have an existing Spring Boot application for an e-commerce Ebook store. The application currently has a method to update the title of the ebook, but it lacks proper security checks. Your task is to implement a security aspect that checks user authorization before allowing the title update. Additionally, you need to authenticate the user before any action in the data layer is performed.
The currently, the EbookRepository extends the RepositoryJpa ...