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.

31.
High
Which interface allows creating custom access decision logic in Spring Security?
32.
High
Which annotation is used to define role hierarchy in Spring Security?
33.
High
Which statement about ConcurrentSessionControlAuthenticationStrategy is true?
34.
High
Which of the following is true for OAuth2 Client in Spring Security?
35.
Medium
Which of the following is a correct way to store JWT in stateless REST APIs?
36.
Medium
Which class in Spring Security is used to represent a user with username, password, and authorities?
37.
High
Which of the following statements about CSRF token repository is correct?
38.
High
What is the difference between @PreAuthorize and @Secured?
39.
High
Which filter in Spring Security handles access-denied exceptions?
40.
High
Which component allows dynamic permission checks for URLs at runtime in Spring Security?
41.
Medium
Which method in Authentication object returns the granted authorities?
42.
High
What is the purpose of DelegatingPasswordEncoder in Spring Security 5?
43.
High
Which statement is true about PreAuthenticatedAuthenticationProvider?
44.
High
Which of the following is true about SecurityFilterChain in Spring Security 5.7+?
45.
High
Which approach allows combining multiple AuthenticationProviders in Spring Security for a single application?
Answered: 0 / 15