Level 1 · Apprentice0 XP
The filter chain, authentication, authorization, and securing an API without fighting the framework.
Step 1 / 5
ProblemSecurity is added, everything returns 401, and after an hour of frustration someone writes anyRequest().permitAll(). The application ships open. Nobody understood what the framework was doing.
← → step
Before this: Packaging and deploying Spring Boot
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Secure an API so that /actuator/health is public, /admin/** needs the ADMIN role and everything else needs a login. Write three MockMvc tests: no credentials gives 401, a normal user on /admin gives 403, an admin gets 200.