Spring Security interview questions
Spring Security Filter Chain
23 questions with answers and explanations · 23 flashcards
Questions
- When configuring Spring Security, which filter should be placed first in the filter chain to handle pre-flight requests?Multiple choiceHard
- What HTTP response code does Spring Security typically return for unauthorized requests?Multiple choiceEasy
- In a stateless JWT token, what component ensures the token's integrity and prevents tampering?Multiple choiceHard
- How does Spring Security handle a request identified as a potential CSRF attack?Multiple choiceEasy
- Why is separating authentication from authorization important in a real system?Multiple choiceEasy
- What does Spring Security's Authentication Filter primarily do?Multiple choiceEasy
- In the context of BCrypt, what does increasing the work factor achieve?Multiple choiceHard
- Which of the following filters in the Spring Security Filter Chain is primarily responsible for ensuring that requests originate from trusted sources and not…Multiple choiceEasy
- In a Spring Security Filter Chain, which filter is typically responsible for handling authentication?Multiple choiceEasy
- In the context of Spring Security, how does the framework ensure that a request has not been tampered with when using JWT?Multiple choiceHard
- After the filter chain authenticates a request, where should an order-ownership rule usually be enforced?Multiple choiceHard
- Why does HTML encoding user inputs in Java web applications matter in practice?Multiple choiceEasy
- Which approach should be used to mitigate SQL injection vulnerabilities in Java applications?Multiple choiceHard
- Why can using a weak BCrypt work factor for password storage in Java become a real problem?Multiple choiceMedium
- Which of the following best describes the purpose of the Spring Security Filter Chain?Multiple choiceMedium
- Why does the CSRF token in Spring Security matter in this design?Multiple choiceMedium
- In Spring Security, what role does the SecurityContextHolder play in handling authentication?Multiple choiceMedium
- Which Spring Security filter is responsible for handling CORS preflight requests?Multiple choiceMedium
- Why do teams use a stateless authentication mechanism such as JWT in Spring Security in production code?Multiple choiceMedium
- Which component of the Spring Security Filter Chain is responsible for preventing unauthorized access to protected resources by returning HTTP 403?Multiple choiceMedium
- Why is it important to use prepared statements in Java when dealing with SQL queries?Multiple choiceMedium
- Why is HTML encoding important in preventing Stored XSS attacks?Multiple choiceMedium
- Why is role=CUSTOMER in a valid JWT often insufficient to authorize GET /orders/123?Multiple choiceMedium