liveBook · Manning

UserDetails

UserDetails is a Spring Security interface representing a user’s identity, credentials, granted authorities, and account status.

How 2 Manning books explain it

Spring Security in Action, Second Edition

UserDetails is a Spring Security representation of a user's identity, password, and granted authorities.

How it is used
Represents application users so Spring Security can authenticate them and evaluate their authorities during authorization.
How deep it goes
Explains every interface method and demonstrates minimal and parameterized implementations, but defers password encoding details.
Examples
Uses DummyUser, SimpleUser, an in-memory user service, a john user, and authenticated cURL requests to test endpoint access.
What you can do after
Build it from scratch: implement UserDetails, provide authorities and status rules, register users, and test authenticated endpoint access.

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

Spring in Action, Sixth Edition

UserDetails is a Spring Security interface that exposes a user's credentials, authorities, and account-status information to the security framework.

How it is used
Connects application user records to Spring Security authentication and authorization.
How deep it goes
Defines authorities, credentials, and account-status methods through a concrete entity implementation.
Examples
Uses a Taco Cloud User entity, ROLE_USER authority, active-account booleans, and username-based repository lookup.
What you can do after
Apply via a UserDetails implementation and custom UserDetailsService that return database-backed users to Spring Security.

Read how Spring in Action, Sixth Edition explains UserDetails →

Also covered in

What to know first

Related concepts

Questions about UserDetails

What is UserDetails?

UserDetails is a Spring Security interface representing a user’s identity, credentials, granted authorities, and account status.

Which Manning books explain UserDetails?

Spring Security in Action, Second Edition and Spring in Action, Sixth Edition.

What should I know before learning UserDetails?

Manning books that teach UserDetails usually introduce authorization and user ID first.

What are the parts of UserDetails?

UserDetails includes getAuthorities(), getPassword() and getUsername().

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.