intermediateManaging Users: UserDetailsService & UserDetailsManager

When would you choose InMemoryUserDetailsManager over a database-backed approach?

InMemoryUserDetailsManager is appropriate for demos, learning, automated tests, or very small internal tools with a fixed, rarely-changing set of users. It's inappropriate for any application with real end-user registration, since data is lost on restart and there's no persistence.

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 Why would a team write a custom UserDetailsService instead of using JdbcUserDetailsManager?← Back to all Spring Security questions