Spring Security’s User class represents an application user with a username, password, and at least one authority. Authorities identify actions the user may perform. Spring Boot supplies security defaults, while application code can define users explicitly. section 2.4
Use User with the surrounding authentication components:
- Store users in application memory with InMemoryUserDetailsManager. section 2.4
- Supply a PasswordEncoder for password handling; NoOpPasswordEncoder keeps passwords in cleartext and suits learning examples, not production. section 2.4
- Connect custom authentication logic through AuthenticationProvider when the standard arrangement is insufficient. section 2.4
A small in-memory user setup
Create a User with a username, password, and authority, then add it to an InMemoryUserDetailsManager. This provides a compact setup for learning authentication and authorization behavior before replacing the in-memory store or password handling. section 2.4
