0
0
Spring Bootframework~20 mins

Spring Security auto-configuration in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spring Security Auto-config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What is the default behavior of Spring Security auto-configuration in a new Spring Boot web app?

When you create a new Spring Boot web application and include Spring Security starter, what does the auto-configuration do by default?

AIt disables security and allows all requests without authentication.
BIt requires manual configuration to enable any security features.
CIt secures only POST requests and allows GET requests without authentication.
DIt secures all HTTP endpoints with basic authentication requiring a generated password.
Attempts:
2 left
💡 Hint

Think about what Spring Security does out of the box to protect your app.

📝 Syntax
intermediate
2:00remaining
Which code snippet correctly disables Spring Security auto-configuration in a Spring Boot app?

You want to disable Spring Security auto-configuration completely. Which of the following code snippets achieves this?

A@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
B@EnableAutoConfiguration(include = SecurityAutoConfiguration.class)
C@SpringBootApplication(disable = SecurityAutoConfiguration.class)
D@EnableSecurityAutoConfiguration(false)
Attempts:
2 left
💡 Hint

Look for the annotation attribute that excludes auto-configuration classes.

state_output
advanced
2:00remaining
What is the value of the default generated password printed by Spring Security auto-configuration?

When Spring Security auto-configures your app, it prints a default password in the console. What is the format of this password?

AA random UUID string generated at startup.
BThe fixed string 'password' for all apps by default.
CAn empty string, meaning no password is set.
DThe username repeated twice as the password.
Attempts:
2 left
💡 Hint

Check the console output when you run a Spring Boot app with Spring Security starter.

🧠 Conceptual
advanced
2:00remaining
Which Spring Boot property disables the default security password generation?

You want to disable the default generated password and allow users to set their own. Which property disables the default password generation?

Aspring.security.user.enabled=false
Bspring.security.user.generate-password=false
Cspring.security.user.password=
Dspring.security.user.default-password=false
Attempts:
2 left
💡 Hint

Setting this property to an empty value disables the generated password.

lifecycle
expert
3:00remaining
In what order does Spring Security auto-configuration apply filters in the filter chain by default?

Spring Security auto-configuration sets up a filter chain for HTTP requests. Which of the following correctly describes the order of these filters?

AExceptionTranslationFilter → FilterSecurityInterceptor → SecurityContextPersistenceFilter → BasicAuthenticationFilter
BSecurityContextPersistenceFilter → BasicAuthenticationFilter → ExceptionTranslationFilter → FilterSecurityInterceptor
CBasicAuthenticationFilter → SecurityContextPersistenceFilter → FilterSecurityInterceptor → ExceptionTranslationFilter
DFilterSecurityInterceptor → ExceptionTranslationFilter → BasicAuthenticationFilter → SecurityContextPersistenceFilter
Attempts:
2 left
💡 Hint

Think about how Spring Security manages context, authentication, exceptions, and authorization.