intermediateManaging Users: UserDetailsService & UserDetailsManager

Why would a team write a custom UserDetailsService instead of using JdbcUserDetailsManager?

JdbcUserDetailsManager expects a fixed default schema (users/authorities tables) that rarely matches a real business domain model. A custom UserDetailsService lets you map your own JPA entity (with whatever additional business fields you need) into Spring Security's UserDetails contract, giving full control over the query and mapping logic.

This is a Pro chapter

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

Why would a team write a custom UserDetailsService instead of using JdbcUserDetailsManager?

Next Step

Continue to What happens if isEnabled() returns false for a user during login?← Back to all Spring Security questions