Spring Security Objective Questions and Answers

This Spring Security quiz contains carefully curated objective questions with correct answers and clear explanations. It is designed for developers, security learners, and interview preparation, covering authentication, authorization, encryption, JWT, OAuth2, and advanced Spring Security concepts.

Practice Spring Security MCQs with Detailed Explanations

Answer at least 12 questions to submit.

16.
High
Which of the following filters runs before UsernamePasswordAuthenticationFilter in Spring Security filter chain?
17.
Medium
What does the method hasAuthority('ADMIN') check in Spring Security?
18.
Medium
Which of the following statements about Remember-Me functionality is correct?
19.
High
Which authentication manager implementation allows multiple AuthenticationProviders in Spring Security?
20.
Medium
What is the default session creation policy in Spring Security?
21.
High
Which filter validates JWT tokens for REST APIs in Spring Security?
22.
High
What is the purpose of SecurityContextHolder in a multi-threaded environment?
23.
High
Which of the following statements about @PostAuthorize is correct?
24.
Medium
Which encryption algorithm is recommended for storing passwords in Spring Security?
25.
Medium
Which Spring Security component handles logout requests automatically?
26.
High
In a stateless REST API using Spring Security, which SessionCreationPolicy is recommended?
27.
High
Which of the following is true for OAuth2 Authorization Server in Spring Security?
28.
High
Which of the following is true about SecurityContextPersistenceFilter?
29.
Medium
Which annotation in Spring Security restricts method access to users with specific roles?
30.
Medium
What is the default behavior of BasicAuthenticationFilter?
Answered: 0 / 15