Spring Security Objective Questions and Answers - Set 3

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. This is part 3 of the series.

Practice Spring Security MCQs with Detailed Explanations

Answer at least 12 questions to submit and verify answers.

31 Which interface allows creating custom access decision logic in Spring Security? High

32 Which annotation is used to define role hierarchy in Spring Security? High

33 Which statement about ConcurrentSessionControlAuthenticationStrategy is true? High

34 Which of the following is true for OAuth2 Client in Spring Security? High

35 Which of the following is a correct way to store JWT in stateless REST APIs? Medium

36 Which class in Spring Security is used to represent a user with username, password, and authorities? Medium

37 Which of the following statements about CSRF token repository is correct? High

38 What is the difference between @PreAuthorize and @Secured? High

39 Which filter in Spring Security handles access-denied exceptions? High

40 Which component allows dynamic permission checks for URLs at runtime in Spring Security? High

41 Which method in Authentication object returns the granted authorities? Medium

42 What is the purpose of DelegatingPasswordEncoder in Spring Security 5? High

43 Which statement is true about PreAuthenticatedAuthenticationProvider? High

44 Which of the following is true about SecurityFilterChain in Spring Security 5.7+? High

45 Which approach allows combining multiple AuthenticationProviders in Spring Security for a single application? High