Spring Security · interview question
Which component of the Spring Security Filter Chain is responsible for preventing unauthorized access to protected resources by returning HTTP 403?
Multiple choiceMediumchapter-17-curatedpremiumspring-securityspring-security-filter-chain
Answer and explanation
Correct answer
B. AccessDeniedHandler
Why
The AccessDeniedHandler is responsible for handling access control violations, such as unauthorized access to protected resources, by returning an HTTP 403 Forbidden status. This ensures that unauthorized users cannot access secured endpoints.
Test yourself on Spring Security
A free test with instant, explained results. No account needed.
More Spring Security questions
- Which of the following best describes the purpose of the Spring Security Filter Chain?
- Why does the CSRF token in Spring Security matter in this design?
- In Spring Security, what role does the SecurityContextHolder play in handling authentication?
- Which Spring Security filter is responsible for handling CORS preflight requests?
- Why do teams use a stateless authentication mechanism such as JWT in Spring Security in production code?
- Why is it important to use prepared statements in Java when dealing with SQL queries?