Spring Security MCQs with answers Page - 2

Here, you will find a collection of MCQ questions on Spring Security. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Arogya • 2.57K Points
Extraordinary

Q. CSRF stands for:

  • (A) Cross Site Request Forgery
  • (B) Central Secure Response Framework
  • (C) Client Side Resource File
  • (D) Cross Server Routing Function

A

Arogya • 2.57K Points
Extraordinary

Q. Spring Security provides protection against:

  • (A) CSRF
  • (B) Session fixation
  • (C) Clickjacking
  • (D) All of the above

A

Arogya • 2.57K Points
Extraordinary

Q. Which authentication type uses username and password in headers?

  • (A) Basic Authentication
  • (B) OAuth2
  • (C) SAML
  • (D) LDAP

A

Arogya • 2.57K Points
Extraordinary

Q. Which filter chain processes security in Spring Security?

  • (A) SecurityFilterChain
  • (B) ServletFilter
  • (C) ControllerAdvice
  • (D) HandlerAdapter

A

Arogya • 2.57K Points
Extraordinary

Q. Which annotation enables web security in Spring Boot?

  • (A) @EnableWebSecurity
  • (B) @SpringBootApplication
  • (C) @ConfigurationProperties
  • (D) @RestController

A

Arogya • 2.57K Points
Extraordinary

Q. Which class is commonly extended to customize Spring Security configuration (older approach)?

  • (A) WebSecurityConfigurerAdapter
  • (B) HttpServlet
  • (C) DispatcherServlet
  • (D) JdbcDaoSupport

A

Arogya • 2.57K Points
Extraordinary

Q. Which method configures HTTP request authorization rules?

  • (A) configure(HttpSecurity http)
  • (B) init(Database db)
  • (C) run(Application app)
  • (D) execute(Query q)

A

Arogya • 2.57K Points
Extraordinary

Q. Which object represents the currently logged-in user?

  • (A) Principal
  • (B) Model
  • (C) ViewResolver
  • (D) DataSource

A

Arogya • 2.57K Points
Extraordinary

Q. What is ROLE_USER in Spring Security?

  • (A) Database table
  • (B) User permission/authority
  • (C) HTTP method
  • (D) Bean scope

A

Arogya • 2.57K Points
Extraordinary

Q. Which login method displays a default login form automatically?

  • (A) formLogin()
  • (B) jdbcLogin()
  • (C) autoLogin()
  • (D) sessionLogin()

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ