• Tutorials
  • Courses
  • Tracks

Advanced Java Quiz Day 64

Last Updated :
Discuss
Comments

Question 1

What is the main purpose of Spring Security?


  • Database management

  • Authentication and authorization

  • API documentation

  • Logging

Question 2

Which of the following is a feature of Spring Security?

  • CSRF protection

  • File compression

  • Automatic database backup

  • Caching

Question 3

In Basic Authentication, credentials are sent:

  • As plain text

  • As Base64 encoded string

  • As JWT token

  • As XML

Question 4

Which HTTP header is used in Basic Authentication?

  • Auth

  • Authentication

  • Authorization

  • Token

Question 5

What is the default state of CSRF protection in Spring Security?

  • Disabled

  • Enabled

  • Only for GET requests

  • Only for POST requests

Question 6

Which method in Spring Security disables CSRF protection?

  • http.disableCsrf()

  • http.csrf().off()

  • http.csrf().disable()

  • http.disable()

Question 7

Why is CSRF protection often disabled in REST APIs?

  • To increase performance

  • Because REST APIs are usually stateless

  • Because it’s not needed in POST requests

  • Because Basic Authentication replaces it

Question 8

Which annotation is used to enable web security in a Spring Boot project?

  • @EnableWebSecurity

  • @SpringSecurity

  • @SecurityEnable

  • @WebAuth

Question 9

What does Basic Authentication lack that makes it less secure than modern methods?

  • Password encryption

  • Token-based authentication

  • Database support

  • Username field

Question 10

Which core component of Spring Security is responsible for delegating authentication requests?

  • DispatcherServlet

  • AuthenticationManager

  • SecurityContext

  • UserDetailsService

There are 10 questions to complete.

Take a part in the ongoing discussion