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.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

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

Next Step

Continue to Why would a team write a custom UserDetailsService instead of using JdbcUserDetailsManager?← Back to all Spring Security questions