liveBook · Manning

UserDetailsService

UserDetailsService is a Spring Security interface for retrieving user-specific data required during authentication.

How 2 Manning books explain it

Spring Security in Action, Second Edition

UserDetailsService is a Spring Security interface for retrieving user-specific data needed to authenticate a user.

How it is used
Retrieves user details for AuthenticationProvider during Spring Security authentication.
How deep it goes
Defines the single retrieval method, custom implementations, provided implementations, registration, and testing, while deferring password encoding details.
Examples
Uses in-memory users, a custom list-backed service, curl requests, and @WithUserDetails integration tests.
What you can do after
Builds or configures a user-details provider and tests authentication against an endpoint.

Read how Spring Security in Action, Second Edition explains UserDetailsService →

Spring in Action, Sixth Edition

UserDetailsService is a Spring Security interface that retrieves user-specific authentication details synchronously.

How it is used
Configures authentication by supplying Spring Security with user-specific details through a UserDetailsService bean.
How deep it goes
Defines the one-method contract and demonstrates in-memory and repository-backed implementations with missing-user handling.
Examples
Uses in-memory users named buzz and woody, then demonstrates a Taco Cloud database lookup through UserRepository.
What you can do after
Build it from scratch by declaring an in-memory or repository-backed UserDetailsService bean.

Read how Spring in Action, Sixth Edition explains UserDetailsService →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.