Loading

Quipoin Menu

Learn • Practice • Grow

spring / Spring Security Basics
mcq
Direction: Choose the correct option

Q1.

What is Spring Security?
A. A framework for authentication and authorization
B. A security module for Spring
C. Both A and B
D. None
Direction: Choose the correct option

Q2.

Which annotation enables Spring Security in a Spring Boot app?
A. @EnableWebSecurity
B. @EnableSecurity
C. @SpringSecurity
D. @SecurityConfig
Direction: Choose the correct option

Q3.

What is authentication in Spring Security?
A. The process of verifying who the user is
B. The process of granting access
C. The process of logging
D. None
Direction: Choose the correct option

Q4.

What is authorization?
A. Determining what an authenticated user is allowed to do
B. Verifying identity
C. Both
D. None
Direction: Choose the correct option

Q5.

What is a UserDetailsService?
A. An interface to load user-specific data during authentication
B. A service to manage users
C. A DAO for users
D. None
Direction: Choose the correct option

Q6.

What does the PasswordEncoder interface do?
A. Encodes passwords for secure storage and matching
B. Encrypts data
C. Hashes passwords
D. Both A and C
Direction: Choose the correct option

Q7.

What is the default login form in Spring Security?
A. A generated login page at /login
B. A custom login page
C. Basic authentication popup
D. None
Direction: Choose the correct option

Q8.

What is the SecurityContextHolder?
A. Holds the security context of the current thread
B. Stores user details
C. Manages sessions
D. None
Direction: Choose the correct option

Q9.

How do you configure which URLs are secured?
A. By overriding configure(HttpSecurity)
B. In application.properties
C. Using annotations
D. All of the above
Direction: Choose the correct option

Q10.

What does .permitAll() do in security configuration?
A. Allows unrestricted access to the specified URLs
B. Denies all
C. Requires authentication
D. None