User management handles the user details and credentials that Spring Security needs during authentication. A UserDetailsService retrieves a user by username, while a PasswordEncoder supports credential verification. section 3.1
Spring Security separates retrieval from broader account administration:
- UserDetailsService supplies the user required to complete authentication. section 3.1
- UserDetails describes the user, including the privileges represented by GrantedAuthority. section 3.1
- UserDetailsManager extends retrieval with operations such as adding, modifying, and deleting users. section 3.1
Figure 3.2 Dependencies between the components involved in user management. The UserDetailsService retrieves a user’s details by searching for the user by name. The user is characterized by the UserDetails contract. Each user possesses one or more authorities, which are depicted by the GrantedAuthority interface. For incorporating operations such as create, delete, or modify password for a user, the UserDetailsManager contract, which expands on the UserDetailsService, is used to include these functionalities.
The dependency diagram shows how user details, authorities, retrieval, and account-management operations fit together. section 3.1
A minimal application can first expose Spring Security defaults, then replace them with custom users and passwords and adjust endpoint authentication requirements. section 2.0

