Spring Security MCQs with answers Page - 6

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 • 3.19K Points
Extraordinary

Q. What is the default login URL provided by Spring Security?

  • (A) /login
  • (B) /signin
  • (C) /auth
  • (D) /user/login

A

Arogya • 3.19K Points
Extraordinary

Q. Which exception is thrown when access is denied?

  • (A) AccessDeniedException
  • (B) AuthenticationException
  • (C) NullPointerException
  • (D) BeanCreationException

A

Arogya • 3.19K Points
Extraordinary

Q. What does stateless session policy mean?

  • (A) Server does not store user session
  • (B) Session stored in database
  • (C) Session stored in cookies
  • (D) Session never expires

A

Arogya • 3.19K Points
Extraordinary

Q. Which Spring Security module supports OAuth2 login?

  • (A) spring-security-oauth2-client
  • (B) spring-security-core
  • (C) spring-security-test
  • (D) spring-security-taglibs

A

Arogya • 3.19K Points
Extraordinary

Q. Which HTTP status code is returned when authentication fails?

  • (A) 401 Unauthorized
  • (B) 403 Forbidden
  • (C) 404 Not Found
  • (D) 500 Internal Server Error

A

Arogya • 3.19K Points
Extraordinary

Q. Which HTTP status code is returned when authorization fails?

  • (A) 403 Forbidden
  • (B) 401 Unauthorized
  • (C) 400 Bad Request
  • (D) 200 OK

A

Arogya • 3.19K Points
Extraordinary

Q. Which Spring Security feature prevents session reuse after login?

  • (A) Session fixation protection
  • (B) CSRF protection
  • (C) CORS configuration
  • (D) Remember-me

A

Arogya • 3.19K Points
Extraordinary

Q. Which annotation allows role-based access using JSR-250?

  • (A) @RolesAllowed
  • (B) @Secured
  • (C) @PreAuthorize
  • (D) @PermitAll

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