intermediateSpring Security Fundamentals

What happens the instant you add `spring-boot-starter-security` to a project with zero configuration?

Every endpoint immediately requires authentication, a default in-memory user named `user` is created with a randomly generated password printed to the console log, and both form-login and HTTP Basic auth are enabled with CSRF protection on. This 'secure by default' stance means a REST API needs explicit configuration to loosen these defaults for its intended auth strategy rather than starting wide open.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What is a `SecurityFilterChain`, and where does it sit in a request's lifecycle?← Back to all Spring Boot questions