Deny access with a 403 Forbidden and allow it to pass with chain.doFilter, protecting the user and admin areas.
What you'll learn in this video:
Sending a 403 Forbidden
Using chain.doFilter
Protecting the user and admin areas
Creating secure endpoints
Chapters:
0:00 Where to place the chain.doFilter
0:40 Sending a 403 Forbidden
2:08 Same control for the admin
2:48 Creating the UserHomeServlet
4:13 Printing the username from the session
5:06 The profile and admin home servlets
6:54 Starting and adding the project
8:43 Testing logins and redirects
10:30 Fixing the filter logic
11:30 403 in the admin area
Full Archety course: https://archety.dev/it/corsi/java-ser...
Full series on YouTube: • Java Servlet e Apache Tomcat: Corso Comple...
Other Java series, by topic:
Spring Boot Basics Course (REST API in Java): • Corso Base Spring Boot | Guida Completa pe...
Thymeleaf (server-side web app): • Thymeleaf con Spring Boot – Template Engin...
Spring Security for REST API: • Spring Security per REST API: guida comple...
REST Security from the Ground Up (cookies, sessions, tokens): • Spring Boot Security Lab: Cookie, Sessioni...
Java Testing (JUnit, Mockito): • Java Testing Completo: JUnit 5, Mockito e ...